-
Notifications
You must be signed in to change notification settings - Fork 138
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
614 lines (599 loc) · 25.8 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
614 lines (599 loc) · 25.8 KB
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
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
# Bound the per-container json log file size on EVERY host. OrbStack
# defaults to a sensible cap (max-size 20m, max-file 5), but vanilla
# Docker on Linux applies NO rotation by default — MongoDB's verbose
# stdout filled `/var/lib/docker/containers/<id>/<id>-json.log` to tens
# of GB on a teammate's machine and corrupted the partition before we
# noticed. Shipping the cap in compose makes the fix portable across
# Mac/Linux/CI without per-machine daemon.json edits.
x-logging: &default-logging
driver: json-file
options:
max-size: '20m'
max-file: '5'
x-app-service-template: &app-service-defaults
build:
context: .
dockerfile: docker/Dockerfile.dev
args:
- API_CLOUD_MODE=${API_CLOUD_MODE:-false}
image: kodus-ai-dev:latest
env_file:
# .env.local (per-dev overrides, gitignored) is loaded LAST so it
# wins over the generated .env — same cascade the app uses at
# runtime. Optional: absent for most devs.
- path: ${ENV_FILE:-.env}
- path: .env.local
required: false
environment:
- CHOKIDAR_USEPOLLING=false
- API_DEVELOPMENT_MODE=${API_DEVELOPMENT_MODE:-true}
# pnpm 11 wants a TTY to confirm purging node_modules when manifests
# change (e.g. after a branch switch). The dev-entrypoint runs
# non-interactively, so CI=true lets pnpm skip the confirmation and
# sync deps instead of aborting with ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY.
- CI=true
restart: unless-stopped
volumes:
- .:/usr/src/app:delegated
- node_modules_cache:/usr/src/app/node_modules
- pnpm_store:/usr/src/app/.pnpm-store
- logs_data:/usr/src/app/logs
networks:
- kodus-backend-services
- shared-network
logging: *default-logging
services:
#----------------------------------------------------------------
# Application Services
#----------------------------------------------------------------
kodus-api:
<<: *app-service-defaults
container_name: kodus_api
depends_on:
rabbitmq:
condition: service_healthy
# Optional so the compose file still validates when the
# `local-db` profile is not active (e.g. pointing at an
# external RabbitMQ). When the local rabbitmq IS running,
# docker waits for its healthcheck before starting.
required: false
ports:
# Host-side port vars (`<HOST>_PORT:-default`) let parallel
# worktrees coexist by overriding to a per-slot offset (e.g.
# `.env.local` in worktree B sets API_DEBUG_PORT=9329 etc).
# Container-side ports stay fixed because each container has
# its own network namespace.
- '${API_PORT:-3001}:${API_PORT:-3001}'
- '${API_DEBUG_PORT:-9229}:9229'
- '${API_METRICS_PORT:-8000}:8000'
command: pnpm run start:dev:api
deploy:
resources:
limits:
# Dev mode with ts-node-dev + Sentry + observability
# + in-memory Nest DI graph routinely climbs past
# 1.5G under modest load; the 1.5G cap caused the
# container to OOM repeatedly mid-session, making
# every /api/proxy/* call 500 while migrations
# re-ran on the restart. Bumped to 3G with matching
# V8 heap ceiling so normal activity has headroom.
memory: 3G
reservations:
memory: 512M
healthcheck:
test:
[
'CMD-SHELL',
'node -e "const http=require(''http''); const port=process.env.API_PORT||3001; const req=http.get({host:''127.0.0.1'', port, path:''/health'', timeout:2000}, (res)=>process.exit(res.statusCode===200?0:1)); req.on(''error'', ()=>process.exit(1)); req.on(''timeout'', ()=>{ req.destroy(); process.exit(1); });"',
]
interval: 20s
timeout: 10s
retries: 8
start_period: 180s
environment:
# pnpm 11 aborts a non-interactive node_modules purge (branch
# switch → manifest drift) without CI=true. Per-service blocks
# override the anchor's environment list, so it must be set here.
- CI=true
- API_CLOUD_MODE=${API_CLOUD_MODE:-false}
- NODE_OPTIONS=--max-old-space-size=2560 --max-semi-space-size=64
- DEBUG_PORT=9229
- API_LOG_PRETTY=true
- CHOKIDAR_USEPOLLING=false
- API_DEVELOPMENT_MODE=${API_DEVELOPMENT_MODE:-true}
- RUN_MIGRATIONS=${RUN_MIGRATIONS:-true}
- RUN_SEEDS=${RUN_SEEDS:-true}
- PYROSCOPE_SERVER_ADDRESS=${PYROSCOPE_SERVER_ADDRESS:-http://pyroscope:4040}
- PYROSCOPE_HEAP_PROFILING=${PYROSCOPE_HEAP_PROFILING:-false}
worker:
<<: *app-service-defaults
container_name: kodus_worker
depends_on:
rabbitmq:
condition: service_healthy
# Optional so the compose file still validates when the
# `local-db` profile is not active (e.g. pointing at an
# external RabbitMQ). When the local rabbitmq IS running,
# docker waits for its healthcheck before starting.
required: false
volumes:
- .:/usr/src/app:delegated
- node_modules_cache:/usr/src/app/node_modules:nocopy
- pnpm_store:/usr/src/app/.pnpm-store
- logs_data:/usr/src/app/logs
ports:
# See kodus-api comment on host-side port parametrization for
# worktree coexistence.
- '${API_WORKER_DEBUG_PORT:-9231}:9231'
- '${API_WORKER_METRICS_PORT:-8001}:8001'
command: pnpm run start:dev:worker
deploy:
resources:
limits:
memory: 2G
reservations:
memory: 512M
healthcheck:
# `node -e 'process.exit(0)'` always passed regardless of app
# state — combined with the silent OOM bug fixed above, the
# container could be in a restart loop and still report
# healthy. pgrep matches the actual nest watch process so a
# crashed dev server is detected. procps is installed in the
# dev image (see Dockerfile.dev).
test: ['CMD-SHELL', 'pgrep -f "nest start worker" >/dev/null']
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
environment:
# pnpm 11 aborts a non-interactive node_modules purge (branch
# switch → manifest drift) without CI=true. Per-service blocks
# override the anchor's environment list, so it must be set here.
- CI=true
- API_CLOUD_MODE=${API_CLOUD_MODE:-false}
# V8 heap kept below the 2G container cap (with ~500M headroom
# for native modules, thread stacks, and Node runtime overhead).
# Previously set to 4096M, which let V8 try to grow past the
# cgroup limit — kernel OOM-killed the process silently while
# the trivial healthcheck kept reporting "healthy".
- NODE_OPTIONS=--max-old-space-size=1536 --max-semi-space-size=64
- DEBUG_PORT=9231
- COMPONENT_TYPE=worker
- API_LOG_PRETTY=true
- PYROSCOPE_SERVER_ADDRESS=${PYROSCOPE_SERVER_ADDRESS:-http://pyroscope:4040}
- PYROSCOPE_HEAP_PROFILING=${PYROSCOPE_HEAP_PROFILING:-false}
- WORKER_ROLE=code-review
# Analytics-only worker — isolates the cockpit ingestion cron from
# the code review event loop / pools. Runs in both cloud and
# self-hosted so the topology stays identical across environments
# (same pipeline, same bugs, same fixes — see issue #951).
worker-analytics:
<<: *app-service-defaults
container_name: kodus_analytics_worker
# Opt-in. Default `pnpm run docker:start` leaves this off — the cockpit
# ingestion cron isn't useful for most dev flows and costs ~700 MiB
# idle (Nest DI + ts-node-dev watch). Bring it up explicitly via
# `KODUS_DEV_EXTRAS=analytics pnpm run docker:start` (or `=extras` for
# all opt-in services).
profiles:
- analytics
- extras
depends_on:
rabbitmq:
condition: service_healthy
required: false
volumes:
- .:/usr/src/app:delegated
- node_modules_cache:/usr/src/app/node_modules:nocopy
- pnpm_store:/usr/src/app/.pnpm-store
- logs_data:/usr/src/app/logs
ports:
# See kodus-api comment on host-side port parametrization for
# worktree coexistence. Container side is 8001 (same as the
# code-review worker — they're the same image; only WORKER_ROLE
# differs); host side is offset to 8011 so both workers can
# publish metrics in parallel.
- '${API_WORKER_ANALYTICS_DEBUG_PORT:-9241}:9241'
- '${API_WORKER_ANALYTICS_METRICS_PORT:-8011}:8001'
command: pnpm run start:dev:worker
deploy:
resources:
limits:
# Bumped from 1G after a smoke test on the heap-fixed
# config showed steady-state RSS around 900MiB (~90%
# of a 1G cap) — too tight for the cron-driven
# analytics ingestion pipeline to absorb spikes.
# Heap remains capped at 768M (see env block below);
# the extra 0.5G is headroom for native modules,
# thread stacks, and ingestion buffers.
memory: 1.5G
reservations:
memory: 256M
healthcheck:
# See worker service for rationale — pgrep replaces the
# always-passing trivial check.
test: ['CMD-SHELL', 'pgrep -f "nest start worker" >/dev/null']
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
environment:
# pnpm 11 aborts a non-interactive node_modules purge (branch
# switch → manifest drift) without CI=true. Per-service blocks
# override the anchor's environment list, so it must be set here.
- CI=true
- API_CLOUD_MODE=${API_CLOUD_MODE:-false}
# V8 heap kept below the 1G container cap. 1536M heap on a
# 1G cgroup let V8 grow past the limit and triggered silent
# OOM kills — see worker service comment.
- NODE_OPTIONS=--max-old-space-size=768 --max-semi-space-size=64
- DEBUG_PORT=9241
- COMPONENT_TYPE=worker
- API_LOG_PRETTY=true
- WORKER_ROLE=analytics
- ANALYTICS_INGESTION_CRON=${ANALYTICS_INGESTION_CRON:-}
- ANALYTICS_CLASSIFIER_CRON=${ANALYTICS_CLASSIFIER_CRON:-}
- ANALYTICS_CLASSIFIER_DISABLED=${ANALYTICS_CLASSIFIER_DISABLED:-}
- PYROSCOPE_SERVER_ADDRESS=${PYROSCOPE_SERVER_ADDRESS:-http://pyroscope:4040}
- PYROSCOPE_HEAP_PROFILING=${PYROSCOPE_HEAP_PROFILING:-false}
webhooks:
<<: *app-service-defaults
container_name: kodus_webhooks
depends_on:
rabbitmq:
condition: service_healthy
# Optional so the compose file still validates when the
# `local-db` profile is not active (e.g. pointing at an
# external RabbitMQ). When the local rabbitmq IS running,
# docker waits for its healthcheck before starting.
required: false
volumes:
- .:/usr/src/app:delegated
- node_modules_cache:/usr/src/app/node_modules:nocopy
- pnpm_store:/usr/src/app/.pnpm-store
- logs_data:/usr/src/app/logs
ports:
# See kodus-api comment on host-side port parametrization for
# worktree coexistence.
- '${API_WEBHOOKS_PORT:-3332}:${API_WEBHOOKS_PORT:-3332}'
- '${API_WEBHOOKS_DEBUG_PORT:-9232}:9232'
- '${API_WEBHOOKS_METRICS_PORT:-8002}:8002'
command: pnpm run start:dev:webhooks
deploy:
resources:
limits:
memory: 1G
reservations:
memory: 256M
healthcheck:
# See worker service for rationale — pgrep replaces the
# always-passing trivial check.
test: ['CMD-SHELL', 'pgrep -f "nest start webhooks" >/dev/null']
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
environment:
# pnpm 11 aborts a non-interactive node_modules purge (branch
# switch → manifest drift) without CI=true. Per-service blocks
# override the anchor's environment list, so it must be set here.
- CI=true
- API_CLOUD_MODE=${API_CLOUD_MODE:-false}
# V8 heap kept below the 1G container cap. 4096M heap on a
# 1G cgroup let V8 grow past the limit and triggered silent
# OOM kills — see worker service comment.
- NODE_OPTIONS=--max-old-space-size=768 --max-semi-space-size=64
- DEBUG_PORT=9232
- API_LOG_PRETTY=true
- PYROSCOPE_SERVER_ADDRESS=${PYROSCOPE_SERVER_ADDRESS:-http://pyroscope:4040}
- PYROSCOPE_HEAP_PROFILING=${PYROSCOPE_HEAP_PROFILING:-false}
mcp-manager:
<<: *app-service-defaults
image: kodus-ai-mcp-manager:latest
container_name: kodus-mcp-manager
# Opt-in. Default `pnpm run docker:start` leaves this off — the web UI
# degrades gracefully (MCP setup/plugins pages show empty state).
# Bring it up via `KODUS_DEV_EXTRAS=mcp pnpm run docker:start` (or
# `=extras` for all opt-in services).
profiles:
- mcp
- extras
ports:
# See kodus-api comment on host-side port parametrization for
# worktree coexistence.
- '${API_MCP_MANAGER_PORT:-3101}:${API_MCP_MANAGER_PORT:-3101}'
- '${API_MCP_MANAGER_DEBUG_PORT:-9230}:9230'
# mcp-manager owns its own schema. ensure-schema + migration
# run inline before the dev server boots (see fix(mcp-manager):
# isolate migration ownership from API entrypoint). The api
# service's dev-entrypoint.sh no longer touches it.
command: sh -c 'pnpm run mcp-manager:ensure-schema && pnpm run mcp-manager:migration:run:internal && pnpm run start:dev:mcp-manager'
deploy:
resources:
limits:
memory: 1G
reservations:
memory: 256M
healthcheck:
test:
[
'CMD-SHELL',
'node -e "const http=require(''http''); const port=process.env.API_MCP_MANAGER_PORT||3101; const req=http.get({host:''127.0.0.1'', port, path:''/health'', timeout:2000}, (res)=>process.exit(res.statusCode===200?0:1)); req.on(''error'', ()=>process.exit(1)); req.on(''timeout'', ()=>{ req.destroy(); process.exit(1); });"',
]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
environment:
# mcp-manager always runs its own ensure-schema + migration
# via the `command:` above (and via prod-entrypoint-mcp-manager
# in prod). We force RUN_MIGRATIONS=false here so the shared
# dev-entrypoint.sh doesn't ALSO run the API/analytics
# migrations from inside this container — those belong to the
# api/worker services, not here.
- RUN_MIGRATIONS=false
# V8 heap kept below the 1G container cap with headroom for
# native modules and runtime overhead.
- NODE_OPTIONS=--max-old-space-size=768 --max-semi-space-size=64
- DEBUG_PORT=9230
- API_MCP_MANAGER_PORT=${API_MCP_MANAGER_PORT:-3101}
- API_MCP_MANAGER_LOG_LEVEL=${API_MCP_MANAGER_LOG_LEVEL:-info}
- API_MCP_MANAGER_NODE_ENV=${API_MCP_MANAGER_NODE_ENV:-development}
- API_MCP_MANAGER_DATABASE_ENV=${API_MCP_MANAGER_DATABASE_ENV:-development}
- API_MCP_MANAGER_CORS_ORIGINS=${API_MCP_MANAGER_CORS_ORIGINS:-*}
- API_MCP_MANAGER_JWT_SECRET=${API_MCP_MANAGER_JWT_SECRET:-}
- API_MCP_MANAGER_ENCRYPTION_SECRET=${API_MCP_MANAGER_ENCRYPTION_SECRET:-}
- API_MCP_MANAGER_PG_DB_SCHEMA=${API_MCP_MANAGER_PG_DB_SCHEMA:-mcp-manager}
- API_MCP_MANAGER_MCP_PROVIDERS=${API_MCP_MANAGER_MCP_PROVIDERS:-kodusmcp,custom}
- API_MCP_MANAGER_REDIRECT_URI=${API_MCP_MANAGER_REDIRECT_URI:-http://localhost:3000/setup/mcp/oauth}
#----------------------------------------------------------------
# Web Frontend
#----------------------------------------------------------------
web:
build:
context: ./apps/web
dockerfile: ../../docker/Dockerfile.web.dev
container_name: kodus_web
depends_on:
kodus-api:
condition: service_healthy
ports:
- '${WEB_PORT:-3000}:3000'
env_file:
# See kodus-api: .env.local is the per-dev override layer.
- path: ${ENV_FILE:-.env}
- path: .env.local
required: false
volumes:
- ./apps/web:/usr/src/app:delegated
# Mount shared monorepo libs at the location apps/web's
# tsconfig path `@libs/*` (= "../../libs/*" relative to
# apps/web baseUrl) resolves to inside the container —
# `/usr/src/app/../../libs/` = `/usr/libs/`. Without this,
# web server components that import from `@libs/feature-gate`
# fail with "module not found" because the libs/ directory
# only lives on the host bind-mount of `apps/web`.
- ./libs:/usr/libs:delegated
- web_node_modules_cache:/usr/src/app/node_modules
- web_next_cache:/usr/src/app/.next
restart: unless-stopped
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000').then((res)=>process.exit(res.ok?0:1)).catch(()=>process.exit(1))",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
networks:
- kodus-backend-services
- shared-network
environment:
- CHOKIDAR_USEPOLLING=false
- NODE_ENV=development
- NEXT_TELEMETRY_DISABLED=1
deploy:
resources:
limits:
memory: 4G
reservations:
memory: 512M
logging: *default-logging
try:
# Public PR review demo (try.kodus.io). Opt-in — the default
# `pnpm run docker:start` skips it because most backend flows don't
# need the marketing-facing surface running. Bring it up with
# `docker compose -f docker-compose.dev.yml --profile demo up try`
# or include it in the `extras` umbrella for everything-at-once.
profiles:
- demo
- extras
build:
context: ./apps/try
dockerfile: ../../docker/Dockerfile.try.dev
container_name: kodus_try
depends_on:
kodus-api:
condition: service_healthy
ports:
- '${TRY_PORT:-3002}:3002'
env_file:
# See kodus-api: .env.local is the per-dev override layer.
- path: ${ENV_FILE:-.env}
- path: .env.local
required: false
volumes:
- ./apps/try:/usr/src/app:delegated
- try_node_modules_cache:/usr/src/app/node_modules
- try_next_cache:/usr/src/app/.next
restart: unless-stopped
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3002/health').then((res)=>process.exit(res.ok?0:1)).catch(()=>process.exit(1))",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
networks:
- kodus-backend-services
- shared-network
environment:
- CHOKIDAR_USEPOLLING=false
- NODE_ENV=development
- NEXT_TELEMETRY_DISABLED=1
# Inside the compose network the API is reachable as
# `kodus-api`, but the browser running outside the network
# hits the public host port instead. NEXT_PUBLIC_* is baked
# into the client bundle at build time / read in the browser,
# so the host-side URL is the correct choice.
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:3001}
deploy:
resources:
limits:
memory: 1G
reservations:
memory: 256M
logging: *default-logging
#----------------------------------------------------------------
# Observability & Profiling
#----------------------------------------------------------------
pyroscope:
# `profiling` is the historic, explicit profile (activated by
# `ENABLE_PROFILING=true` or `pnpm run docker:start:profiling`).
# `extras` is the new umbrella alongside mcp-manager and
# worker-analytics — `pnpm run docker:start:full` brings everything
# up in one command.
profiles:
- profiling
- extras
- infra
image: docker.io/grafana/pyroscope:latest
container_name: pyroscope
ports:
- '4040:4040'
volumes:
- pyroscope-data:/var/lib/pyroscope
networks:
- kodus-backend-services
restart: unless-stopped
logging: *default-logging
#----------------------------------------------------------------
# Databases & Infrastructure
#----------------------------------------------------------------
rabbitmq:
build:
context: ./docker/rabbitMQ
dockerfile: Dockerfile
container_name: rabbitmq
hostname: ${RABBITMQ_HOSTNAME:-rabbitmq-local}
ports:
- '5672:5672'
- '15672:15672'
- '15692:15692'
environment:
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER:-dev}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS:-devpass}
- RABBITMQ_HOSTNAME=${RABBITMQ_HOSTNAME:-rabbitmq}
- RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbit disk_free_limit 1000000000 -rabbit heartbeat 60
volumes:
- rabbitmq-data:/var/lib/rabbitmq
restart: unless-stopped
networks:
kodus-backend-services:
aliases:
- rabbitmq-local
- rabbitmq
shared-network:
aliases:
- rabbitmq-local
- rabbitmq
healthcheck:
test: ['CMD', 'rabbitmq-diagnostics', '-q', 'check_running']
interval: 30s
timeout: 10s
retries: 5
ulimits:
nofile:
soft: 65536
hard: 65536
logging: *default-logging
command: /usr/local/bin/init-definitions.sh
db_postgres:
image: docker.io/pgvector/pgvector:pg16
container_name: db_postgres
ports:
- '5432:5432'
environment:
POSTGRES_USER: ${API_PG_DB_USERNAME}
POSTGRES_PASSWORD: ${API_PG_DB_PASSWORD}
POSTGRES_DB: ${API_PG_DB_DATABASE}
volumes:
- pgdata:/var/lib/postgresql/data
- ./docker/postgres/initdb.d:/docker-entrypoint-initdb.d
networks:
- kodus-backend-services
restart: unless-stopped
healthcheck:
test:
[
'CMD-SHELL',
'pg_isready -U ${API_PG_DB_USERNAME} -d ${API_PG_DB_DATABASE}',
]
interval: 5s
timeout: 3s
retries: 20
start_period: 10s
logging: *default-logging
db_mongodb:
image: docker.io/mongo:8
container_name: mongodb
ports:
- '27017:27017'
volumes:
- mongodbdata:/data/db
environment:
MONGO_INITDB_ROOT_USERNAME: ${API_MG_DB_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${API_MG_DB_PASSWORD}
MONGO_INITDB_DATABASE: ${API_MG_DB_DATABASE}
networks:
- kodus-backend-services
restart: unless-stopped
healthcheck:
test:
[
'CMD-SHELL',
"echo 'db.runCommand({ ping: 1 }).ok' | mongosh --quiet mongodb://$${MONGO_INITDB_ROOT_USERNAME}:$${MONGO_INITDB_ROOT_PASSWORD}@localhost:27017/admin | grep -q 1",
]
interval: 10s
timeout: 5s
retries: 20
start_period: 20s
logging: *default-logging
volumes:
node_modules_cache:
pnpm_store:
logs_data:
web_node_modules_cache:
web_next_cache:
try_node_modules_cache:
try_next_cache:
pgdata:
mongodbdata:
pyroscope-data:
rabbitmq-data:
networks:
kodus-backend-services:
driver: bridge
name: kodus-backend-services
external: true
shared-network:
external: true