-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
97 lines (92 loc) · 2.14 KB
/
docker-compose.yml
File metadata and controls
97 lines (92 loc) · 2.14 KB
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
93
94
95
96
97
services:
backend:
build:
context: .
container_name: backend
hostname: backend
restart: on-failure
volumes:
- .:/app
- static_volume:/app/public/static
- media_volume:/app/public/media
- log_volume:/app/logs
command: >
sh -c "python manage.py makemigrations --noinput &&
python manage.py migrate --noinput &&
python manage.py seed_preferences &&
python manage.py collectstatic --noinput &&
gunicorn -b 0.0.0.0:8000 --worker-class=gevent --worker-connections=1000 --workers=2 root.wsgi"
stdin_open: true
depends_on:
redis:
condition: service_healthy
tty: true
networks:
- shared_network
healthcheck:
test: ["CMD", "curl", "-f", "http://backend:8000/health/"]
interval: 30s
timeout: 10s
retries: 5
worker:
container_name: worker
build: .
restart: on-failure
env_file:
- .env
command: >
sh -c "celery -A root worker --loglevel=info"
depends_on:
backend:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "celery -A root inspect ping"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
volumes: [.:/app]
networks:
- shared_network
redis:
image: redis:6.2-alpine
container_name: redis
restart: always
networks:
- shared_network
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 3
nginxrp:
container_name: nginxrp
restart: always
build: ./nginx-server
ports:
- 80:80
depends_on:
backend:
condition: service_healthy
worker:
condition: service_healthy
redis:
condition: service_healthy
networks:
- shared_network
volumes:
- static_volume:/app/public/static
- media_volume:/app/public/media
- log_volume:/app/logs
volumes:
redis_data:
static_volume:
media_volume:
log_volume:
networks:
shared_network:
driver: bridge