-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
69 lines (69 loc) · 1.88 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
60
61
62
63
64
65
66
67
68
69
services:
web:
build:
context: .
dockerfile: Dockerfile_prod
command: sh -c "cd arch/ &&
gunicorn arch.wsgi:application --workers=2 --threads=2 --bind 0.0.0.0:8000"
env_file:
- .env.prod
expose:
- 8000
entrypoint: ["/app/entrypoint.prod.sh"]
healthcheck:
test: curl --fail http://localhost:8000/ || exit 1
interval: 20s
timeout: 5s
retries: 3
depends_on:
db:
condition: service_healthy
volumes:
- static_volume:/app/arch/staticfiles
- media_volume:/app/arch/media
task_queue:
build:
context: .
dockerfile: Dockerfile_prod
command: python arch/manage.py qcluster
env_file:
- .env.prod
volumes:
- media_volume:/app/arch/media
depends_on:
db:
condition: service_healthy
web:
condition: service_healthy
db:
image: postgres:14
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- .env.db
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -h localhost -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 20s
timeout: 5s
retries: 3
nginx:
build: ./nginx
volumes:
- static_volume:/app/arch/staticfiles
- media_volume:/app/arch/media
ports:
- "1337:80"
depends_on:
web:
condition: service_healthy
healthcheck:
test: service nginx status || exit 1
interval: 20s
timeout: 5s
retries: 3
volumes:
static_volume:
media_volume:
postgres_data: