-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
96 lines (94 loc) · 2.3 KB
/
docker-compose.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
version: '3.8'
services:
wsgi:
build:
context: ./backend/
dockerfile: ../docker/django/Dockerfile
command: gunicorn sqtrex.wsgi:application --log-file=- --bind 0.0.0.0:8000
expose:
- 8000
volumes:
- media_volume:/home/app/web/media
env_file:
- ./.env.prod
depends_on:
- db
restart: always
asgi:
build:
context: ./backend/
dockerfile: ../docker/django/Dockerfile
command: daphne --port 8001 --bind 0.0.0.0 sqtrex.asgi:application
expose:
- 8001
env_file:
- ./.env.prod
depends_on:
- db
- redis
restart: always
huey:
build:
context: ./backend/
dockerfile: ../docker/django/Dockerfile
command: python manage.py run_huey
env_file:
- ./.env.prod
depends_on:
- redis
restart: always
db:
image: postgres:12.3-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- ./.env.prod.db
restart: always
frontend:
build:
context: ./frontend/
dockerfile: ../docker/frontend/Dockerfile
volumes:
- frontend_data:/usr/src/app/dist/frontend
frontend-android:
build:
context: ./frontend/
dockerfile: ../docker/frontend-android/Dockerfile
volumes:
- frontend-android_data:/usr/src/app/dist/frontend-android
nginx:
build: ./docker/nginx
volumes:
- frontend_data:/usr/src/app/dist/frontend
- frontend-android_data:/usr/src/app/dist/frontend-android
- media_volume:/home/app/web/media
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
ports:
- 80:80
- 443:443
depends_on:
- frontend
- frontend-android
- wsgi
- asgi
- certbot
restart: always
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:
- ./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;'"
redis:
image: redis:6
expose:
- 6379
restart: always
volumes:
postgres_data:
frontend_data:
frontend-android_data:
media_volume: