Repository navigation
Expand file tree
/
Copy pathcompose.yml
More file actions
76 lines (70 loc) · 1.59 KB
/
Copy pathcompose.yml
File metadata and controls
76 lines (70 loc) · 1.59 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
services:
db:
image: postgres:latest
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASS}
POSTGRES_DB: ${DB_NAME}
volumes:
- pgdata:/var/lib/postgresql/data
expose:
- 5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
redis:
image: redis:latest
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
web:
build: .
command: bash -c "python manage.py migrate &&
python manage.py collectstatic --noinput &&
gunicorn config.wsgi:application --bind 0.0.0.0:8000"
env_file: .env
expose:
- 8000
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
restart: on-failure
nginx:
image: nginx:latest
ports:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- web
restart: on-failure
celery_worker:
build: .
command: celery -A config worker --loglevel=info
env_file: .env
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
restart: on-failure
celery_beat:
build: .
command: celery -A config beat --loglevel=info
env_file: .env
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
restart: on-failure
volumes:
pgdata: