-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yaml
More file actions
116 lines (112 loc) · 2.61 KB
/
Copy pathdocker-compose.prod.yaml
File metadata and controls
116 lines (112 loc) · 2.61 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
services:
db:
image: postgres:16-alpine
container_name: dd-prod-db
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:?required}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?required}
POSTGRES_DB: ${POSTGRES_DB:-dockerdash}
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB:-dockerdash}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
- dd-network
deploy:
resources:
limits:
cpus: "1"
memory: 512M
reservations:
cpus: "0.25"
memory: 128M
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
backend:
image: shipwright-backend:prod
build:
context: ./backend
dockerfile: Dockerfile
container_name: dd-prod-backend
restart: unless-stopped
ports:
- "8080:8080"
environment:
DATABASE_URL: postgres://${POSTGRES_USER:?required}:${POSTGRES_PASSWORD:?required}@db:5432/${POSTGRES_DB:-dockerdash}?sslmode=disable
JWT_SECRET: ${JWT_SECRET:?required}
LOG_LEVEL: ${LOG_LEVEL:-info}
PORT: "8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
db:
condition: service_healthy
networks:
- dd-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/health"]
interval: 30s
timeout: 3s
start_period: 10s
retries: 3
deploy:
resources:
limits:
cpus: "2"
memory: 512M
reservations:
cpus: "0.5"
memory: 128M
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
frontend:
image: shipwright-frontend:prod
build:
context: ./frontend
dockerfile: Dockerfile
args:
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-}
container_name: dd-prod-frontend
restart: unless-stopped
ports:
- "80:80"
depends_on:
backend:
condition: service_healthy
networks:
- dd-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80/"]
interval: 30s
timeout: 3s
start_period: 5s
retries: 3
deploy:
resources:
limits:
cpus: "1"
memory: 256M
reservations:
cpus: "0.25"
memory: 64M
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
volumes:
pgdata:
networks:
dd-network:
driver: bridge