Mirror of https://github.com/roostorg/coop
github.com/roostorg/coop
1services:
2 redis:
3 image: redis:8.6.1-trixie
4 volumes:
5 - redis_data:/data
6 ports:
7 - '6379:6379'
8
9 # Runs all migrations from scratch, after clearing the database(s).
10 migrations:
11 image: node:24.14.0-bullseye-slim
12 command: bash -c 'set -e
13 npm i && ( [ "$CI" = "true" ] && npm run db:clean -- --env staging || true )
14 && for db in api-server-pg scylla clickhouse; do npm run db:create -- --db "$$db" --env staging; npm run db:update -- --db "$$db" --env staging; done'
15 working_dir: /src
16 env_file: ./.env.githubci
17 environment:
18 - MIGRATOR_DB_NAME
19 - CLICKHOUSE_DATABASE
20 volumes:
21 - .:/src
22 depends_on:
23 postgres:
24 condition: service_healthy
25 scylla:
26 condition: service_healthy
27 clickhouse:
28 condition: service_healthy
29
30 drop_dbs:
31 image: node:24.14.0-bullseye-slim
32 command: bash -c 'npm i && npm run db:drop -- --env staging'
33 working_dir: /src
34 env_file: ./.env.githubci
35 environment:
36 - CLICKHOUSE_DATABASE
37 - MIGRATOR_DB_NAME
38 volumes:
39 - .:/src
40 depends_on:
41 - postgres
42
43 postgres:
44 image: ankane/pgvector:v0.5.1
45 # image: postgres:15.3
46 volumes:
47 - pg_data:/var/lib/postgresql/data
48 ports:
49 - '5432:5432'
50 healthcheck:
51 test: ['CMD', 'pg_isready', '-U', 'postgres', '-d', 'postgres']
52 interval: 2s
53 start_period: 2s
54 environment:
55 POSTGRES_PASSWORD: postgres123
56 POSTGRES_USER: postgres
57 POSTGRES_DB: postgres
58
59 hma:
60 build:
61 context: ./hma
62 dockerfile: Dockerfile
63 environment:
64 - POSTGRES_PASSWORD=postgres123
65 - POSTGRES_USER=postgres
66 - POSTGRES_DB=postgres
67 - POSTGRES_HOST=postgres
68 ports:
69 - '9876:9876'
70 depends_on:
71 - postgres
72
73 scylla:
74 image: scylladb/scylla:5.2
75 volumes:
76 - scylla_data:/var/lib/scylla
77 ports:
78 - '9042:9042'
79 healthcheck:
80 test: ['CMD-SHELL', 'nodetool status || exit 1']
81 interval: 5s
82 timeout: 5s
83 retries: 28
84 start_period: 35s
85
86 # Runs the api server's tests
87 test:
88 build:
89 context: .
90 dockerfile: Dockerfile
91 target: server_base
92 command: bash -c 'npm run test:ci'
93 working_dir: /app
94 volumes:
95 - ./server/reports:/app/reports
96 env_file: ./.env.githubci
97 depends_on:
98 migrations:
99 condition: service_completed_successfully
100 redis:
101 condition: service_started
102
103
104 lint:
105 build:
106 context: .
107 dockerfile: Dockerfile
108 target: server_base
109 command: npm run lint
110
111 lint-client:
112 build:
113 context: client
114 target: client_base
115 command: npm run lint
116 volumes:
117 - ./client/eslint:/app/eslint
118 - ./client/.eslintrc.cjs:/app/.eslintrc.cjs
119 - ./client/eslint.config.mjs:/app/eslint.config.mjs
120
121 jaeger:
122 image: jaegertracing/all-in-one:1.76.0
123 ports:
124 - '16686:16686'
125 - '14268'
126 - '14250'
127 environment:
128 - LOG_LEVEL=info
129
130 otel-collector:
131 # We have to pin to this version of the collector, because versions beyond
132 # this do not support the Jaeger exporter. See here for details:
133 # https://github.com/open-telemetry/opentelemetry-specification/pull/2858
134 image: otel/opentelemetry-collector-contrib:0.71.0
135 volumes:
136 - ./otel-collector.yaml:/etc/otel-collector.yaml
137 command: ['--config=/etc/otel-collector.yaml']
138 ports:
139 - '1888:1888' # pprof extension
140 - '13133:13133' # health_check extension
141 - '4317:4317' # OTLP gRPC receiver
142 - '55670:55679' # zpages extension
143 depends_on:
144 - jaeger
145
146 clickhouse:
147 image: clickhouse/clickhouse-server:24.3
148 container_name: clickhouse
149 ports:
150 - '8123:8123' # HTTP interface
151 - '9000:9000' # Native TCP interface
152 volumes:
153 - clickhouse_data:/var/lib/clickhouse
154 environment:
155 CLICKHOUSE_DB: analytics
156 CLICKHOUSE_USER: default
157 CLICKHOUSE_PASSWORD: 'clickhouse'
158 healthcheck:
159 test: ['CMD-SHELL', 'clickhouse-client --host localhost --query "SELECT 1"']
160 interval: 5s
161 timeout: 3s
162 retries: 5
163
164volumes:
165 pg_data:
166 scylla_data:
167 redis_data:
168 clickhouse_data: