-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-production.yml
69 lines (64 loc) · 1.68 KB
/
docker-compose-production.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
version: '3'
services:
web:
restart: always
image: nekeal/passit
volumes:
- web-static:/app/public
- web-media:/app/media
links:
- redis:redis
environment:
DJANGO_SETTINGS_MODULE: passit.settings.production
env_file:
- .env
command: bash -c "python manage.py migrate
&& python manage.py collectstatic --noinput
&& gunicorn -b 0:8000 passit.wsgi"
depends_on:
- redis
celery:
restart: always
image: nekeal/passit
volumes:
- web-static:/app/public
- web-media:/app/media
links:
- redis:redis
environment:
DJANGO_SETTINGS_MODULE: passit.settings.production
env_file:
- .env
command: bash -c "celery -A passit worker -B"
redis:
image: 'redis:5.0.8-alpine'
ports:
- '6379:6379'
volumes:
- redisdata:/data
nginx:
image: nginx:1.17.3
restart: unless-stopped
volumes:
- web-static:/www/static
- web-media:/www/media
- ./deployment/configs/certbot/conf:/etc/letsencrypt
- ./deployment/configs/certbot/www:/var/www/certbot
- ./deployment/configs/nginx:/etc/nginx/conf.d
links:
- web:web
ports:
- "80:80"
- "443:443"
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
image: certbot/certbot
restart: unless-stopped
volumes:
- ./deployment/configs/certbot/conf:/etc/letsencrypt
- ./deployment/configs/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
volumes:
web-static:
web-media:
redisdata: