forked from boostcampwm-2024/web15-OctoDocs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.prod.yml
109 lines (103 loc) · 2.22 KB
/
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
106
107
108
109
version: "3.8"
services:
nginx:
image: summersummerwhy/octodocs-nginx:latest
env_file:
- .env.server
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./data/certbot/conf:/etc/letsencrypt:ro
- ./data/certbot/www:/var/www/certbot
networks:
- frontend
depends_on:
backend:
condition: service_healthy
websocket:
condition: service_healthy
backend:
image: summersummerwhy/octodocs-backend:latest
env_file:
- .env.server
expose:
- "3000"
networks:
- frontend
- backend
depends_on:
redis:
condition: service_healthy
healthcheck:
test:
[
"CMD",
"wget",
"--no-verbose",
"--tries=1",
"--spider",
"http://localhost:3000/api/health",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: always
websocket:
image: summersummerwhy/octodocs-websocket:latest
env_file:
- .env.server
expose:
- "4242"
networks:
- frontend
- backend
depends_on:
backend:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test:
[
"CMD",
"wget",
"--no-verbose",
"--tries=1",
"--spider",
"http://localhost:4242/health",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: always
redis:
image: redis:latest
env_file:
- .env.server
networks:
- backend
- frontend
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
retries: 3
start_period: 10s
timeout: 5s
restart: always
certbot-renewer:
image: certbot/certbot:latest
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
- ./data/certbot/log:/var/log/letsencrypt
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew --webroot --webroot-path=/var/www/certbot; sleep 12h & wait $${!}; done;'"
restart: always
networks:
frontend:
driver: bridge
backend:
driver: bridge