-
Notifications
You must be signed in to change notification settings - Fork 11
/
docker-compose.prod.yaml
52 lines (47 loc) · 1.01 KB
/
docker-compose.prod.yaml
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
version: "3.8"
services:
db:
image: postgres:12
restart: always
env_file:
- .env
volumes:
- postgres_data:/var/lib/postgresql/data
server:
build:
context: ./
dockerfile: Dockerfile
container_name: onlinetestsuite
depends_on:
- db
command: >
bash -c "python manage.py makemigrations &&
python manage.py migrate &&
python manage.py collectstatic --no-input &&
gunicorn OnlineTestSuite.wsgi:application --bind 0.0.0.0:8000 --workers 4"
volumes:
- ./static:/ots/static
- ./media:/ots/media
- ./:/ots
ports:
- "8000:8000"
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
nginx:
build:
context: ./nginx
dockerfile: Dockerfile
ports:
- "80:80"
volumes:
- ./static:/ots/static
- ./media:/ots/media
depends_on:
- server
restart: always
volumes:
postgres_data: