-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
51 lines (47 loc) · 1.25 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
51 lines (47 loc) · 1.25 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
# Local development stack — Nginx serves built SPA, Express serves API
# Run: npm run build -w packages/web && docker compose -f docker-compose.dev.yml up
services:
app:
build:
context: .
target: production
ports:
- "3001:3001"
environment:
- NODE_ENV=production
- PORT=3001
- POSTGRES_HOST=db
- POSTGRES_PORT=5432
- POSTGRES_DB=notes_world
- POSTGRES_USER=notes_world
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-devpassword}
- JWT_SECRET=${JWT_SECRET}
- CORS_ORIGIN=http://localhost
depends_on:
db:
condition: service_healthy
restart: unless-stopped
nginx:
image: nginx:alpine
ports:
- "80:80"
volumes:
- ./nginx/nginx.dev.conf:/etc/nginx/conf.d/default.conf:ro
- ./packages/web/dist:/var/www/notes-world:ro
depends_on:
- app
db:
image: postgres:16-alpine
environment:
- POSTGRES_DB=notes_world
- POSTGRES_USER=notes_world
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-devpassword}
volumes:
- postgres_dev_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U notes_world"]
interval: 5s
timeout: 5s
retries: 10
volumes:
postgres_dev_data: