-
Notifications
You must be signed in to change notification settings - Fork 13
/
docker-compose.prod.yml
59 lines (53 loc) · 1.19 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
version: '3.3'
services:
db:
image: postgres:12
env_file:
.env
volumes:
- postgres_data:/var/lib/postgresql/data/
ports:
- "5432:5432"
rabbitmq:
image: rabbitmq:3.8-management
ports:
- "5672:5672"
- "15672:15672"
env_file:
.env
backend:
build: .
deploy:
restart_policy:
condition: on-failure
max_attempts: 3
command: >-
bash -c "python manage.py makemigrations &&
python manage.py makemigrations interface &&
python manage.py migrate --noinput &&
python manage.py migrate --noinput interface &&
python manage.py collectstatic --no-input &&
python manage.py loaddata /backend/language_model.json &&
gunicorn judge.wsgi:application --bind 0.0.0.0:8000 --workers 4"
volumes:
- ./:/backend:rw
- ./static:/backend/static/
- ./media:/backend/media/
env_file:
- .env
ports:
- "8000:8000"
depends_on:
- db
- rabbitmq
nginx:
build: ./nginx
volumes:
- ./static:/backend/static/
- ./media:/backend/media/
ports:
- "80:80"
depends_on:
- backend
volumes:
postgres_data: