-
Notifications
You must be signed in to change notification settings - Fork 3
/
compose.prod.yml
103 lines (97 loc) · 2.83 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
version: "3.8"
services:
nginx:
image: nginx:alpine
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./services/nginx/conf.d/prod_nginx.conf:/etc/nginx/conf.d/default.conf
- ./data/certbot/conf:/etc/letsencrypt:ro
- ./data/certbot/www:/var/www/certbot
- ./apps/frontend/dist:/usr/share/nginx/html:ro
networks:
- frontend
depends_on:
backend:
condition: service_healthy
websocket:
condition: service_healthy
backend:
build:
context: .
dockerfile: ./services/backend/Dockerfile.prod
image: backend:latest
env_file:
- .env.prod
volumes:
- .env.prod:/app/.env
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:
build:
context: .
dockerfile: ./services/websocket/Dockerfile.prod
image: websocket:latest
env_file:
- .env.prod
volumes:
- .env.prod:/app/apps/websocket/.env
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
environment:
REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT}
networks:
- backend
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