Here are different tools I use throughout my Docker swarm
- 🐑Shepherd
-
Swarm-cronjob
-
Apprise
- prune-nodes : remove unused/exited tasks
version: '3.8' services: scheduler: image: crazymax/swarm-cronjob:latest volumes: - /var/run/docker.sock:/var/run/docker.sock:ro environment: - 'TZ=Europe/Paris' - 'LOG_LEVEL=info' - 'LOG_JSON=false' deploy: placement: constraints: - node.role == manager
prune-nodes: image: docker command: ['docker', 'system', 'prune', '--all', '--volumes' , '-f'] volumes: - '/var/run/docker.sock:/var/run/docker.sock' deploy: mode: global labels: - swarm.cronjob.enable=true - swarm.cronjob.schedule=0 15 6 * * * - swarm.cronjob.skip-running=true restart_policy: condition: none
# shepherd:# image: containrrr/shepherd:master# environment:# - TZ='Europe/Paris'# - RUN_ONCE_AND_EXIT=true# - WITH_REGISTRY_AUTH=true# - APPRISE_SIDECAR_URL=notify:5000# - VERBOSE=true# volumes:# - /var/run/docker.sock:/var/run/docker.sock# - /home/raphaelgc/.docker/config.json:/root/.docker/config.json:ro# deploy:# replicas: 0# restart_policy:# condition: none# labels:# - swarm.cronjob.enable=true# - swarm.cronjob.schedule=0 0 6 * * *# - swarm.cronjob.skip-running=true# placement:# constraints:# - node.role == manager
notify: image: mazzolino/apprise-microservice environment: - NOTIFICATION_URLS=discord://${DISCORD_ID}/${DISCORD_TOKEN} deploy: placement: constraints: - node.role == manager