-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
68 lines (64 loc) · 1.53 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
version: "3"
services:
db:
image: mysql:5.7
volumes:
- ./log/mysql:/var/lib/mysql
- ./config/mysql/my.cnf:/etc/mysql/my.cnf
expose:
- 3306
restart: always
env_file:
- config/config.env
networks:
- db_network
redis:
image: redis
command: redis-server
expose:
- 6379
restart: always
networks:
- db_network
app:
build: .
command: /bin/bash -c "python manage.py makemigrations && python manage.py migrate && celery multi start w1 -A backend.celery -l info --logfile=/var/log/celery/celery.log && uwsgi --ini uwsgi.ini --enable-threads --thunder-lock"
restart: always
volumes:
- ./backend:/code
- ./log/celery/:/var/log/celery/
expose:
- 80
depends_on:
- db
- redis
env_file:
- config/config.env
networks:
- web_network
- db_network
nginx:
image: nginx
restart: always
volumes:
- ./log/nginx/:/var/log/nginx/
- ./web/dist:/var/www/web
- ./backend/media:/var/www/media
- ./config/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./config/nginx/conf.d:/etc/nginx/conf.d
- ./config/ssl:/ssl
env_file:
- config/config.env
command: /bin/bash -c "envsubst '$$NGINX_HOST' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
ports:
- 443:443
- 80:80
depends_on:
- app
networks:
- web_network
networks:
web_network:
driver: bridge
db_network:
driver: bridge