-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
83 lines (74 loc) · 1.62 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
version: '3.6'
services:
django:
container_name: food_fact
build: ./django/
image: django_app
env_file: .env
volumes:
- app_volume:/app
- static_volume:/app/staticfiles
- media_volume:/app/public/media
command: bash -c "python3 manage.py makemigrations --merge && python3 manage.py collectstatic --no-input && gunicorn --bind=0.0.0.0:8000 app.wsgi:application"
restart: on-failure
depends_on:
- redis
networks:
- nginx_network
- redis_network
nginx:
container_name: nginx
image: nginx
ports:
- 80:80
volumes:
- ./nginx/:/etc/nginx/conf.d
- static_volume:/app/staticfiles
- media_volume:/app/public/media
restart: on-failure
depends_on:
- django
networks:
- nginx_network
celery:
container_name: celery
image: django_app
restart: on-failure
env_file: '.env'
command: 'python3 -m celery -A app.celery_settings worker --pool=eventlet -l info'
volumes:
- app_volume:/app
depends_on:
- django
- redis
networks:
- redis_network
redis:
container_name: redis
image: redis:latest
ports:
- 6379:6379
volumes:
- redis_volume:/data
networks:
- redis_network
cron:
container_name: cron
build: ./cron/
restart: on-failure
env_file: '.env'
volumes:
- app_volume:/app
command: 'cron && tail -f /var/log/cron.log'
depends_on:
- django
networks:
nginx_network:
driver: bridge
redis_network:
driver: bridge
volumes:
app_volume:
static_volume:
media_volume:
redis_volume: