Skip to content

Instantly share code, notes, and snippets.

@zibellon
Last active May 30, 2024 11:51
Show Gist options
  • Save zibellon/43f6d460a274241a66d392fcdbd6a61f to your computer and use it in GitHub Desktop.
Save zibellon/43f6d460a274241a66d392fcdbd6a61f to your computer and use it in GitHub Desktop.
version: "3.9"
services:
master:
image: docker:25.0.5-cli-alpine3.20
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: swarm-backuper-sh
target: /swarm-backuper-sh.sh
mode: 0777
entrypoint: [""]
command: >
sh -c "
apk add bash && apk add jq &&
echo '0 3 * * * /swarm-backuper-sh.sh' > /etc/crontabs/root &&
crond -f -L /dev/stdout
"
networks:
main-overlay-net:
aliases:
- swarm-backuper
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.role==manager
configs:
swarm-backuper-sh:
external: true
networks:
main-overlay-net:
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment