@@ -10,15 +10,17 @@ services:
1010 condition : service_healthy
1111 redis :
1212 condition : service_healthy
13+ celery-worker :
14+ condition : service_healthy
1315 networks :
1416 default : {}
1517 sysctls :
1618 - net.ipv6.conf.all.disable_ipv6=0
1719 command : /start
1820 healthcheck :
19- test : ["CMD", "curl", "-f", "http://localhost:8000/process_updates /"]
21+ test : ["CMD", "curl", "-f", "http://localhost:8000/health /"]
2022 interval : 30s
21- timeout : 30s
23+ timeout : 2s
2224 start_period : 30s
2325 retries : 5
2426 deploy :
@@ -35,15 +37,17 @@ services:
3537 condition : service_healthy
3638 django :
3739 condition : service_healthy
40+ celery-worker-secondary :
41+ condition : service_healthy
3842 networks :
3943 default : {}
4044 sysctls :
4145 - net.ipv6.conf.all.disable_ipv6=0
4246 command : /start
4347 healthcheck :
44- test : ["CMD", "curl", "-f", "http://localhost:8000/process_updates /"]
48+ test : ["CMD", "curl", "-f", "http://localhost:8000/health /"]
4549 interval : 30s
46- timeout : 30s
50+ timeout : 2s
4751 start_period : 30s
4852 retries : 5
4953 deploy :
@@ -129,3 +133,93 @@ services:
129133 - net.ipv6.conf.all.disable_ipv6=0
130134 deploy :
131135 replicas : ${TRANSLATOR_REPLICAS:-0}
136+
137+ celery-worker :
138+ build :
139+ context : .
140+ dockerfile : ./compose/production/celery/Dockerfile
141+ depends_on :
142+ redis :
143+ condition : service_healthy
144+ healthcheck :
145+ test : ["CMD", "celery", "-A", "scheduler.app:scram_api_scheduler", "inspect", "ping"]
146+ interval : 30s
147+ timeout : 10s
148+ start_period : 30s
149+ retries : 3
150+ restart : unless-stopped
151+
152+ celery-worker-secondary :
153+ build :
154+ context : .
155+ dockerfile : ./compose/production/celery/Dockerfile
156+ depends_on :
157+ redis :
158+ condition : service_healthy
159+ healthcheck :
160+ test : ["CMD", "celery", "-A", "scheduler.app:scram_api_scheduler", "inspect", "ping"]
161+ interval : 30s
162+ timeout : 10s
163+ start_period : 30s
164+ retries : 3
165+ restart : unless-stopped
166+ deploy :
167+ replicas : ${CELERY_WORKER_REPLICAS:-0}
168+
169+ celery-beat :
170+ build :
171+ context : .
172+ dockerfile : ./compose/production/celery/Dockerfile
173+ depends_on :
174+ redis :
175+ condition : service_healthy
176+ celery-worker :
177+ condition : service_healthy
178+ restart : unless-stopped
179+
180+ celery-beat-secondary :
181+ build :
182+ context : .
183+ dockerfile : ./compose/production/celery/Dockerfile
184+ depends_on :
185+ redis :
186+ condition : service_healthy
187+ celery-worker-secondary :
188+ condition : service_healthy
189+ restart : unless-stopped
190+ deploy :
191+ replicas : ${CELERY_BEAT_REPLICAS:-0}
192+
193+ flower :
194+ build :
195+ context : .
196+ dockerfile : ./compose/production/celery/Dockerfile
197+ depends_on :
198+ redis :
199+ condition : service_healthy
200+ celery-worker :
201+ condition : service_healthy
202+ healthcheck :
203+ test : ["CMD", "curl", "-f", "http://localhost:5555/healthcheck"]
204+ interval : 30s
205+ timeout : 5s
206+ retries : 3
207+ restart : unless-stopped
208+
209+ flower-secondary :
210+ build :
211+ context : .
212+ dockerfile : ./compose/production/celery/Dockerfile
213+ depends_on :
214+ redis :
215+ condition : service_healthy
216+ celery-worker-secondary :
217+ condition : service_healthy
218+ healthcheck :
219+ test : ["CMD", "curl", "-f", "http://localhost:5555/healthcheck"]
220+ interval : 30s
221+ timeout : 5s
222+ retries : 3
223+ restart : unless-stopped
224+ deploy :
225+ replicas : ${FLOWER_REPLICAS:-0}
0 commit comments