-
Notifications
You must be signed in to change notification settings - Fork 108
/
docker-compose.full.yml
438 lines (410 loc) · 12.1 KB
/
docker-compose.full.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
name: 'full-cosmo'
services:
# Services for the demo
employees:
container_name: employees
environment:
OTEL_AUTH_TOKEN: ${OTEL_AUTH_TOKEN}
OTEL_HTTP_ENDPOINT: ${OTEL_HTTP_ENDPOINT:-otelcollector:4318}
build:
context: ./demo
dockerfile: Dockerfile.employees
profiles:
- subgraphs
ports:
- '4001:4001'
networks:
- primary
family:
container_name: family
environment:
OTEL_AUTH_TOKEN: ${OTEL_AUTH_TOKEN}
OTEL_HTTP_ENDPOINT: ${OTEL_HTTP_ENDPOINT:-otelcollector:4318}
build:
context: ./demo
dockerfile: Dockerfile.family
profiles:
- subgraphs
ports:
- '4002:4002'
networks:
- primary
hobbies:
container_name: hobbies
environment:
OTEL_AUTH_TOKEN: ${OTEL_AUTH_TOKEN}
OTEL_HTTP_ENDPOINT: ${OTEL_HTTP_ENDPOINT:-otelcollector:4318}
build:
context: ./demo
dockerfile: Dockerfile.hobbies
profiles:
- subgraphs
ports:
- '4003:4003'
networks:
- primary
products:
environment:
OTEL_AUTH_TOKEN: ${OTEL_AUTH_TOKEN}
OTEL_HTTP_ENDPOINT: ${OTEL_HTTP_ENDPOINT:-otelcollector:4318}
container_name: products
build:
context: ./demo
dockerfile: Dockerfile.products
profiles:
- subgraphs
ports:
- '4004:4004'
networks:
- primary
availability:
container_name: availability
environment:
OTEL_AUTH_TOKEN: ${OTEL_AUTH_TOKEN}
OTEL_HTTP_ENDPOINT: ${OTEL_HTTP_ENDPOINT:-otelcollector:4318}
build:
context: ./demo
dockerfile: Dockerfile.availability
profiles:
- subgraphs
ports:
- '4007:4007'
networks:
- primary
mood:
container_name: mood
environment:
OTEL_AUTH_TOKEN: ${OTEL_AUTH_TOKEN}
OTEL_HTTP_ENDPOINT: ${OTEL_HTTP_ENDPOINT:-otelcollector:4318}
build:
context: ./demo
dockerfile: Dockerfile.mood
profiles:
- subgraphs
ports:
- '4008:4008'
networks:
- primary
products_fg:
container_name: products_fg
environment:
OTEL_AUTH_TOKEN: ${OTEL_AUTH_TOKEN}
OTEL_HTTP_ENDPOINT: ${OTEL_HTTP_ENDPOINT:-otelcollector:4318}
build:
context: ./demo
dockerfile: Dockerfile.products_fg
profiles:
- subgraphs
ports:
- '4010:4010'
networks:
- primary
# Infrastructure services
clickhouse:
image: clickhouse/clickhouse-server:${DC_CLICKHOUSE_VERSION:-24.6}
environment:
CLICKHOUSE_DB: ${CLICKHOUSE_DATABASE:-cosmo}
CLICKHOUSE_USER: ${CLICKHOUSE_USER:-default}
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD:-changeme}
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: ${CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT:-1}
ports:
- '8123:8123'
- '9000:9000'
- '9440:9440'
profiles:
- default
networks:
- primary
volumes:
- clickhouse:/var/lib/clickhouse
- ./docker/clickhouse/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
postgres:
image: postgres:${DC_POSTGRESQL_VERSION:-15.3}
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
POSTGRES_DB: ${POSTGRES_DB:-controlplane}
PGDATA: /data/postgres
volumes:
- ./docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
- postgres:/data/postgres
ports:
- '5432:5432'
profiles:
- default
restart: unless-stopped
networks:
- primary
keycloak:
image: ghcr.io/wundergraph/cosmo/keycloak:${DC_KEYCLOAK_VERSION:-latest}
environment:
KEYCLOAK_EXTRA_ARGS: '--import-realm --optimized'
KEYCLOAK_ENABLE_HEALTH_ENDPOINTS: 'true'
KEYCLOAK_ENABLE_STATISTICS: 'true'
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN:-admin}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:-changeme}
KEYCLOAK_DATABASE_PORT: ${POSTGRES_PORT:-5432}
KEYCLOAK_DATABASE_HOST: ${POSTGRES_HOST:-postgres}
KEYCLOAK_DATABASE_NAME: ${POSTGRES_DB_NAME:-keycloak}
KEYCLOAK_DATABASE_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
KEYCLOAK_DATABASE_USER: ${POSTGRES_USER:-postgres}
ports:
- '8080:8080'
volumes:
- ./docker/keycloak/realm.json:/opt/bitnami/keycloak/data/import/realm.json:ro
restart: unless-stopped
networks:
- primary
profiles:
- default
depends_on:
- postgres
minio:
image: bitnami/minio:${DC_MINIO_VERSION:-2024.7.16-debian-12-r0}
environment:
- MINIO_ROOT_USER=${MINIO_ROOT_USER:-minio}
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD:-changeme}
- MINIO_DEFAULT_BUCKETS=cosmo
ports:
- '10000:9000'
- '10001:9001'
volumes:
- minio:/bitnami/minio/data
restart: unless-stopped
networks:
- primary
profiles:
- default
nats:
image: nats:${DC_NATS_VERSION:-2.10.6}
profiles:
- default
ports:
- '4222:4222'
- '8222:8222'
- '6222:6222'
networks:
- primary
# Cosmo Platform
cdn:
build:
context: .
dockerfile: cdn-server/Dockerfile
environment:
PORT: 11000
NODE_ENV: development
AUTH_JWT_SECRET: fkczyomvdprgvtmvkuhvprxuggkbgwld
AUTH_ADMISSION_JWT_SECRET: uXDxJLEvrw4aafPfrf3rRotCoBzRfPEW
S3_STORAGE_URL: ${S3_STORAGE_URL:-http://${MINIO_ROOT_USER:-minio}:${MINIO_ROOT_PASSWORD:-changeme}@minio:9000/cosmo}
S3_REGION: ${S3_REGION_CDN:-${S3_REGION:-auto}}
S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID}
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY}
S3_FORCE_PATH_STYLE: ${S3_FORCE_PATH_STYLE:-true}
ports:
- '11000:11000'
networks:
- primary
profiles:
- default
graphqlmetrics:
image: ghcr.io/wundergraph/cosmo/graphqlmetrics:${DC_GRAPHQLMETRICS_VERSION:-latest}
environment:
CLICKHOUSE_DSN: 'clickhouse://${CLICKHOUSE_USER:-default}:${CLICKHOUSE_PASSWORD:-changeme}@clickhouse:9000/${CLICKHOUSE_DATABASE:-cosmo}'
INGEST_JWT_SECRET: ${INGEST_JWT_SECRET:-fkczyomvdprgvtmvkuhvprxuggkbgwld}
LISTEN_ADDR: '0.0.0.0:4005'
ports:
- '4005:4005'
restart: unless-stopped
profiles:
- default
depends_on:
- clickhouse
networks:
- primary
otelcollector:
image: ghcr.io/wundergraph/cosmo/otelcollector:${DC_OTELCOLLECTOR_VERSION:-latest}
environment:
CLICKHOUSE_ENDPOINT: 'clickhouse://${CLICKHOUSE_USER:-default}:${CLICKHOUSE_PASSWORD:-changeme}@clickhouse:9000/${CLICKHOUSE_DATABASE:-cosmo}?dial_timeout=15s&compress=lz4'
OTEL_INGEST_JWT_SECRET: ${OTEL_INGEST_JWT_SECRET:-fkczyomvdprgvtmvkuhvprxuggkbgwld}
PROMETHEUS_LISTEN_ADDR: ${PROMETHEUS_LISTEN_ADDR:-127.0.0.1:8088}
PROMETHEUS_LEVEL: ${PROMETHEUS_LEVEL:-none}
ports:
- '4318:4318'
restart: unless-stopped
profiles:
- default
depends_on:
- clickhouse
networks:
- primary
controlplane:
image: ghcr.io/wundergraph/cosmo/controlplane:${DC_CONTROLPLANE_VERSION:-latest}
environment:
DB_URL: 'postgresql://postgres:changeme@postgres:5432/controlplane'
PORT: 3001
HOST: '0.0.0.0'
ALLOWED_ORIGINS: 'http://localhost:3000'
LOG_LEVEL: 'info'
DEBUG_SQL: 'true'
CLICKHOUSE_DSN: 'http://default:changeme@clickhouse:8123?database=cosmo'
AUTH_REDIRECT_URI: 'http://localhost:3001/v1/auth/callback'
WEB_BASE_URL: 'http://localhost:3000'
AUTH_JWT_SECRET: 'fkczyomvdprgvtmvkuhvprxuggkbgwld'
AUTH_ADMISSION_JWT_SECRET: 'uXDxJLEvrw4aafPfrf3rRotCoBzRfPEW'
KC_CLIENT_ID: 'studio'
KC_REALM: 'cosmo'
KC_ADMIN_USER: ${KEYCLOAK_ADMIN:-admin}
KC_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:-changeme}
KC_API_URL: 'http://keycloak:8080'
KC_FRONTEND_URL: 'http://localhost:8080'
PROMETHEUS_API_URL: 'http://admin:test@prometheus:9090/api/v1'
S3_STORAGE_URL: ${S3_STORAGE_URL:-http://${MINIO_ROOT_USER:-minio}:${MINIO_ROOT_PASSWORD:-changeme}@minio:9000/cosmo}
S3_REGION: ${S3_REGION_CONTROLPLANE:-${S3_REGION:-auto}}
S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID}
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY}
S3_FORCE_PATH_STYLE: ${S3_FORCE_PATH_STYLE:-true}
CDN_BASE_URL: 'http://cdn:11000'
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: 'test'
ports:
- '3001:3001'
restart: on-failure
networks:
- primary
profiles:
- default
depends_on:
- postgres
- clickhouse
redis:
image: redis:${DC_REDIS_VERSION:-7.2.4}-alpine
ports:
- '6379:6379'
volumes:
- ./docker/redis/redis.conf:/usr/local/etc/redis/redis.conf
- redis:/data
profiles:
- default
networks:
- primary
router:
image: ghcr.io/wundergraph/cosmo/router:${DC_ROUTER_VERSION:-latest}
environment:
LOG_LEVEL: info
CORS_ALLOW_CREDENTIALS: true
LISTEN_ADDR: '0.0.0.0:3002'
CONTROLPLANE_URL: http://controlplane:3001
DEFAULT_TELEMETRY_ENDPOINT: http://otelcollector:4318
GRAPHQL_METRICS_COLLECTOR_ENDPOINT: http://graphqlmetrics:4005
GRAPH_API_TOKEN: ${ROUTER_TOKEN}
CDN_URL: http://cdn:11000
HTTPS_PROXY: ${HTTPS_PROXY}
HTTP_PROXY: ${HTTP_PROXY}
NO_PROXY: ${NO_PROXY}
restart: on-failure
volumes:
# Mount the example config from the repo into the working dir of the router binary location
# In order apply changes to the config, you need to restart the router container
# docker compose -f docker-compose.full.yml --profile router restart router
- ./router/config.yaml:/config.yaml
networks:
- primary
profiles:
- router
ports:
- '3002:3002'
studio:
image: ghcr.io/wundergraph/cosmo/studio:${DC_STUDIO_VERSION:-latest}
environment:
NEXT_PUBLIC_COSMO_CP_URL: http://localhost:3001
NEXT_PUBLIC_COSMO_STUDIO_URL: http://localhost:3000
HOSTNAME: '0.0.0.0'
profiles:
- default
ports:
- '3000:3000'
# Migrations & Seed
seed:
image: ghcr.io/wundergraph/cosmo/controlplane:${DC_CONTROLPLANE_VERSION:-latest}
command:
- '/app/dist/bin/seed.js'
environment:
KC_REALM: 'cosmo'
KC_API_URL: 'http://keycloak:8080'
KC_ADMIN_USER: 'admin'
KC_ADMIN_PASSWORD: 'changeme'
KC_CLIENT_ID: 'studio'
API_KEY: cosmo_669b576aaadc10ee1ae81d9193425705
DB_URL: 'postgresql://postgres:changeme@postgres:5432/controlplane'
USER_EMAIL: [email protected]
USER_PASSWORD: wunder@123
USER_FIRSTNAME: foo
USER_LASTNAME: bar
ORGANIZATION_NAME: wundergraph
ORGANIZATION_SLUG: wundergraph
restart: on-failure
networks:
- primary
profiles:
- default
depends_on:
- postgres
- clickhouse
- keycloak
clickhouse-migration:
image: ghcr.io/wundergraph/cosmo/controlplane:${DC_CONTROLPLANE_VERSION:-latest}
command: node dist/bin/ch-migrate.js
depends_on:
- clickhouse
environment:
- CLICKHOUSE_DSN=clickhouse://default:changeme@clickhouse:9000/cosmo
networks:
- primary
profiles:
- default
restart: on-failure
database-migration:
image: ghcr.io/wundergraph/cosmo/controlplane:${DC_CONTROLPLANE_VERSION:-latest}
command: node dist/bin/db-migrate.js
depends_on:
- postgres
environment:
- DB_URL=postgresql://postgres:changeme@postgres:5432/controlplane
networks:
- primary
profiles:
- default
restart: on-failure
# Use this to intercept request e.g. from the router by setting the HTTP(S)_PROXY env var to http://mitmproxy:9051.
# docker compose -f docker-compose.full.yml --profile proxy up -d mitmproxy
mitmproxy:
image: mitmproxy/mitmproxy:latest
command:
- mitmweb
- --web-host
- 0.0.0.0
- --web-port
- '8081'
- --mode
- regular@8080
restart: on-failure
profiles:
- proxy
networks:
- primary
ports:
- '9051:8080' # proxy
- '9050:8081' # web interface
# This network is shared between this file and docker-compose.yml to
# allow the demo subgraphs to communicate with the rest of the infra-networks:
networks:
primary:
driver: bridge
name: primary
volumes:
postgres:
clickhouse:
prometheus:
minio:
redis: