File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -320,6 +320,23 @@ services:
320
320
command : celery --app internetnl worker --without-gossip --pool=eventlet --time-limit=300 --concurrency=$WORKER_CONCURRENCY
321
321
--queues nassl_worker
322
322
323
+ # cron daemon with access to Docker socket to restart worker-nassl periodically to solve memory issues
324
+ restart-nassl-worker :
325
+ image : alpinelinux/docker-cli:latest
326
+ command : crond -f -d7
327
+ configs :
328
+ - source : restart_nassl_worker_cron
329
+ target : /etc/periodic/hourly/restart_nassl_worker
330
+ mode : 0755
331
+ restart : unless-stopped
332
+ logging :
333
+ driver : $LOGGING_DRIVER
334
+ options :
335
+ tag : ' {{.Name}}'
336
+ network_mode : " none"
337
+ volumes :
338
+ - /var/run/docker.sock:/var/run/docker.sock
339
+
323
340
# worker for slow and long running tasks that could require a lot of memory (eg: hof update)
324
341
worker-slow :
325
342
# copy all attributes from 'worker' service and overwrite specific settings below
@@ -882,6 +899,12 @@ configs:
882
899
}
883
900
884
901
902
+ restart_nassl_worker_cron :
903
+ content : |
904
+ #!/bin/sh
905
+ set -e
906
+ # find nassl worker and restart the container
907
+ docker restart $(docker ps --filter label=com.docker.compose.service=worker-nassl --quiet)
885
908
886
909
networks :
887
910
# disable default network
You can’t perform that action at this time.
0 commit comments