-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.prod.yml
105 lines (96 loc) · 2.13 KB
/
docker-compose.prod.yml
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
version: '3'
services:
frontend:
build:
context: ./client
image: fadyamir/frontend
env_file:
- ./client/.env.production
networks:
- app-network
deploy:
mode: replicated
replicas: 1
update_config:
parallelism: 1
delay: 5s
restart_policy:
condition: on-failure
max_attempts: 3
window: 80s
backend:
build:
context: ./server
image: fadyamir/backend
env_file:
- ./server/.env.production
environment:
- NODE_ENV=production
networks:
- app-network
- backend-network
deploy:
mode: replicated
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
database:
volumes:
- db-data:/data/db
networks:
- backend-network
deploy:
restart_policy:
condition: on-failure
nginx:
volumes:
- ./nginx/fake-ssl:/etc/nginx/ssl:ro
- certbot-etc:/etc/letsencrypt
- certbot-var:/var/lib/letsencrypt
- web-root:/var/www/html
secrets:
- dhparam-secret
configs:
- source: nginx_conf
target: /etc/nginx/nginx.conf
- source: nginx_default_conf
target: /etc/nginx/conf.d/default.conf
networks:
- app-network
deploy:
restart_policy:
condition: on-failure
certbot:
image: certbot/certbot
volumes:
- certbot-etc:/etc/letsencrypt
- certbot-var:/var/lib/letsencrypt
- web-root:/var/www/html
depends_on:
- nginx
networks:
- app-network
# command: certonly --staging --webroot --webroot-path=/var/www/html --email [email protected] --agree-tos --no-eff-email -d example.com -d www.example.com
networks:
app-network:
driver: bridge # overlay
backend-network:
driver: bridge # overlay
volumes:
db-data:
certbot-etc:
certbot-var:
web-root:
configs:
nginx_conf:
file: ./nginx/nginx.conf
nginx_default_conf:
file: ./nginx/default.conf
secrets:
dhparam-secret:
file: ./nginx/dhparam/dhparam-2048.pem