-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.prod.yml
106 lines (97 loc) · 2.2 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
106
version: '3'
services:
watchtower:
container_name: watchtower
image: containrrr/watchtower
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --interval 300 gservicegroup asgiserver celery
wsgiserver:
image: esdp2/gservicegroup:latest
container_name: gservicegroup
restart: always
command: gunicorn core.wsgi:application --bind 0.0.0.0:8000 --workers 3
volumes:
- static_volume:/app/static
expose:
- 8000
env_file:
- ./.env_prod
depends_on:
- postgres
- redis
asgiserver:
image: esdp2/gservicegroup:latest
container_name: asgiserver
restart: always
command: daphne core.asgi:application -b 0.0.0.0 -p 8000
env_file:
- ./.env_prod
volumes:
- ./app/:/usr/src/app/
links:
- postgres
- redis
expose:
- 8000
depends_on:
- redis
postgres:
container_name: postgres
image: postgres:latest
restart: always
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- ./.env_prod.db
redis:
container_name: redis
image: redis:latest
restart: always
ports:
- "6379:6379"
volumes:
- redis:/data
celery:
container_name: celery
image: esdp2/celery:latest
restart: always
volumes:
- .:/app
env_file:
- .env_prod
links:
- redis
depends_on:
- redis
- wsgiserver
- asgiserver
nginx:
build: ./nginx
container_name: nginx
restart: always
volumes:
- static_volume:/app/static
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
ports:
- "80:80"
- "443:443"
depends_on:
- wsgiserver
- asgiserver
- celery
certbot:
image: certbot/certbot
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
volumes:
postgres_data:
redis:
static_volume:
certbot:
watchtower: