-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
134 lines (126 loc) · 3.09 KB
/
Copy pathdocker-compose.yml
File metadata and controls
134 lines (126 loc) · 3.09 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
services:
postgres:
image: postgres:16-alpine
env_file: .env
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
bootstrap:
build:
context: .
dockerfile: Dockerfile
env_file: .env
volumes:
- .:/app
- static_volume:/app/staticfiles
- media_volume:/app/media
working_dir: /app/src
command: ["python", "manage.py", "bootstrap_project"]
restart: "no"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
nginx:
image: nginx:1.27-alpine
depends_on:
web:
condition: service_healthy
ports:
- "${NGINX_PORT:-80}:80"
volumes:
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
healthcheck:
test: ["CMD-SHELL", "wget -q -O - http://127.0.0.1/health/ >/dev/null 2>&1 || exit 1"]
interval: 15s
timeout: 5s
retries: 5
web:
build:
context: .
dockerfile: Dockerfile
env_file: .env
volumes:
- .:/app
- static_volume:/app/staticfiles
- media_volume:/app/media
working_dir: /app/src
command: ["python", "/usr/local/bin/start-web.py"]
expose:
- "8000"
depends_on:
bootstrap:
condition: service_completed_successfully
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/ready/', timeout=5).read()\""]
interval: 15s
timeout: 10s
retries: 5
celery_worker:
build:
context: .
dockerfile: Dockerfile
env_file: .env
volumes:
- .:/app
working_dir: /app/src
command: ["celery", "-A", "workspace", "worker", "--loglevel=info"]
depends_on:
bootstrap:
condition: service_completed_successfully
postgres:
condition: service_healthy
redis:
condition: service_healthy
celery_beat:
build:
context: .
dockerfile: Dockerfile
env_file: .env
volumes:
- .:/app
working_dir: /app/src
command: ["celery", "-A", "workspace", "beat", "--loglevel=info"]
depends_on:
bootstrap:
condition: service_completed_successfully
postgres:
condition: service_healthy
redis:
condition: service_healthy
flower:
build:
context: .
dockerfile: Dockerfile
env_file: .env
volumes:
- .:/app
working_dir: /app/src
command: ["celery", "-A", "workspace", "flower", "--port=5555"]
depends_on:
bootstrap:
condition: service_completed_successfully
redis:
condition: service_healthy
ports:
- "${FLOWER_BIND:-5555}:5555"
volumes:
postgres_data:
static_volume:
media_volume: