forked from Carbon-Ledger-stellar/carbonledger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
53 lines (50 loc) · 1.38 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
53 lines (50 loc) · 1.38 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
version: "3.9"
# Production overlay — rolling zero-downtime deployment.
# Usage: docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d --no-deps --scale backend=2 backend
services:
backend:
restart: always
deploy:
replicas: 2
update_config:
parallelism: 1 # replace one replica at a time
delay: 15s # wait between each replica
failure_action: rollback
order: start-first # new container starts before old one stops
rollback_config:
parallelism: 1
failure_action: continue
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:3001/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 20s
frontend:
restart: always
deploy:
replicas: 2
update_config:
parallelism: 1
delay: 10s
failure_action: rollback
order: start-first
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:3000"]
interval: 10s
timeout: 5s
retries: 3
start_period: 20s
nginx:
image: nginx:alpine
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./infra/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- /etc/letsencrypt:/etc/letsencrypt:ro
- /var/www/certbot:/var/www/certbot:ro
depends_on:
- backend
- frontend