-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.prod.yml
43 lines (41 loc) · 1.17 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
version: "3.8"
services:
web:
image: "${WEB_IMAGE}"
command: gunicorn deckzap.wsgi:application --bind 0.0.0.0:8000
volumes:
- static_volume:/usr/src/app/staticfiles
- media_volume:/usr/src/app/mediafiles
ports:
- 8000
env_file: .env
asgi:
image: "${WEB_IMAGE}"
command: daphne -b 0.0.0.0 -p 8000 deckzap.asgi:application
ports:
- 8000
env_file: .env
nginx:
image: nginx:1.21-alpine
volumes:
- static_volume:/usr/src/app/staticfiles
- media_volume:/usr/src/app/mediafiles
- ./nginx/data/nginx:/etc/nginx/conf.d
- ./nginx/data/certbot/conf:/etc/letsencrypt
- ./nginx/data/certbot/www:/var/www/certbot
ports:
- 80:80
- 443:443
depends_on:
- web
- asgi
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
image: certbot/certbot
volumes:
- ./nginx/data/certbot/conf:/etc/letsencrypt
- ./nginx/data/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
volumes:
static_volume:
media_volume: