generated from mathieusouflis/turborepo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yaml
More file actions
51 lines (48 loc) · 1.17 KB
/
docker-compose.prod.yaml
File metadata and controls
51 lines (48 loc) · 1.17 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
services:
monorepo:
container_name: turborepo-monorepo-prod
image: monorepo-prod
build:
context: .
dockerfile: ./dockerfile.prod
env_file:
- .env.prod
- .env
environment:
NODE_ENV: production
DB_URL: postgresql://${DB_USER:-root}:${DB_PASSWORD:-root}@db:5432/${DB_NAME:-database}
ports:
- "${FRONTEND_PORT:-5173}:${FRONTEND_PORT:-5173}"
- "${BACKEND_PORT:-7070}:${BACKEND_PORT:-7070}"
depends_on:
db:
condition: service_healthy
networks:
- app-network
restart: unless-stopped
db:
container_name: turborepo-postgres-prod
image: postgres:16-alpine
restart: always
environment:
DB_USER: ${DB_USER:-root}
DB_PASSWORD: ${DB_PASSWORD:-root}
DB_NAME: ${DB_NAME:-database}
volumes:
- db_data_prod:/var/lib/postgresql/data
ports:
- "${DB_PORT:-5432}:5432"
healthcheck:
test:
["CMD-SHELL", "pg_isready -U ${DB_USER:-root} -d ${DB_NAME:-database}"]
interval: 10s
timeout: 5s
retries: 3
networks:
- app-network
volumes:
db_data_prod:
driver: local
networks:
app-network:
driver: bridge