-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose-v2.yml
92 lines (87 loc) · 2.04 KB
/
docker-compose-v2.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
version: '3.3'
services:
thebackend_nginx:
image: nginx:latest
container_name: AIC21_Backend_nginx
restart: always
ports:
- 800:800
volumes:
- ./static/:/static/
- ./media/:/media/
- /var/log/AIC21_Backend/nginx/:/var/log/nginx/
- ./deploy/config/nginx:/etc/nginx/conf.d
depends_on:
- aic21_backend_web
aic21_backend_web:
build: .
container_name: AIC21_Backend_web
restart: always
depends_on:
- rabbitmq
- postgres
- redis
environment:
DJANGO_SETTINGS_MODULE: "AIC21_Backend.settings.production"
command: >
sh -c "
./manage.py migrate;
./manage.py compilemessages;
./manage.py collectstatic --noinput;
gunicorn --bind=0.0.0.0:8000 --timeout=90 --workers=10 --preload AIC21_Backend.wsgi:application;
"
volumes:
- .:/code
- ./static/:/static/
- ./media/:/media/
- /var/log/AIC21_Backend:/var/log/AIC21_Backend
- cachedata:/cachec
ports:
- 8000:8000
env_file:
- .env
rabbitmq:
container_name: rabbitmq
image: rabbitmq:3-management
environment:
- RABBITMQ_DEFAULT_USER=aic
- RABBITMQ_DEFAULT_PASS=aic21challenge
ports:
- 5672:5672
celery:
container_name: celery
build: .
command: ["celery", "-A", "AIC21_Backend", "worker", "-l", "info", "-E", "--concurrency=10"]
depends_on:
- rabbitmq
links:
- rabbitmq
volumes:
- ./static/:/static/
- ./media/:/media/
- /var/log/AIC21_Backend:/var/log/AIC21_Backend
postgres:
restart: always
image: postgres:latest
volumes:
- ./media/:/media/
- pgdata:/var/lib/postgresql/data/
env_file:
- .env
ports:
- 5432:5432
environment:
- POSTGRES_DB=${DB_NAME}
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
redis:
image: redis:latest
container_name: redis
ports:
- 6379:6379
volumes:
- redisdata:/data
volumes:
pgdata:
redisdata:
cachedata: