-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
98 lines (93 loc) · 2.8 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
98 lines (93 loc) · 2.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
# Development override.
#
# Usage:
# docker compose -f docker-compose.yml -f docker-compose.dev.yml up
# (or `make up-dev`)
#
# Differences from production compose:
# - node-api: bind-mount services/node-api/src, --watch enabled, LOG_LEVEL=debug
# - node-api: also bind-mounts migrations/ so they're picked up live
# - node-api: DATABASE_URL points to the local `db` service by default
# - db: new service — postgres 16 alpine, exposed on host port 55432
# - web: replaces nginx with a Node container running Vite dev server (5173)
#
# To target Supabase from local dev instead of the bundled `db` service,
# set DATABASE_URL in .env (it overrides the default below) and stop the
# `db` service: `docker compose stop db`.
services:
node-api:
environment:
NODE_ENV: development
LOG_LEVEL: debug
# Default to the local `db` service; override via .env DATABASE_URL.
DATABASE_URL: ${DATABASE_URL:-postgresql://postgres:postgres@db:5432/app}
command:
- node
- --watch
- --experimental-strip-types
- --experimental-sqlite
- src/index.ts
volumes:
- ./services/node-api/src:/app/services/node-api/src:ro
- ./migrations:/app/migrations:ro
- api-data-dev:/data
depends_on:
db:
condition: service_healthy
spring-api:
environment:
# Override the prod profile: in `make up-dev` we point Spring at the
# bundled `db` service, not Supabase.
SPRING_PROFILES_ACTIVE: dev
SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/app
SPRING_DATASOURCE_USERNAME: postgres
SPRING_DATASOURCE_PASSWORD: postgres
LOGGING_LEVEL_ROOT: DEBUG
depends_on:
db:
condition: service_healthy
node-api:
# node-api owns the schema (migrations); wait for it to be healthy
# so the users table exists before Spring queries it.
condition: service_healthy
db:
image: postgres:16-alpine
container_name: ntsa-db-dev
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: app
ports:
- "${DB_PORT:-55432}:5432"
volumes:
- db-data-dev:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d app"]
interval: 5s
timeout: 3s
retries: 10
start_period: 5s
networks:
- app
web:
image: node:22-alpine
container_name: ntsa-web-dev
working_dir: /repo/web
command:
- sh
- -c
- "npm install && npm run dev -- --host 0.0.0.0"
volumes:
- ./web:/repo/web
- ./docs:/repo/docs:ro
- web-node-modules:/repo/web/node_modules
ports:
- "5173:5173"
healthcheck:
disable: true
depends_on: []
volumes:
api-data-dev:
db-data-dev:
web-node-modules: