Variables, Dockerfile, better syntax, etc.

This commit is contained in:
3wc
2021-11-06 19:45:39 +02:00
parent 49ed657084
commit 8317f50a8a
5 changed files with 80 additions and 24 deletions

View File

@ -2,6 +2,13 @@
Automatically backup files from running Docker Swarm services based on labels.
## Background
There are lots of Docker volume backup systems; all of them have one or both of
these problems:
- You need to define all the volumes to back up in the configuration system
- Backups require services to be stopped to take consistent copies
## TODO
- [ ] Make a Docker image of this
@ -13,8 +20,9 @@ Automatically backup files from running Docker Swarm services based on labels.
(Haven't done secrets yet, here are two options)
v1:
```
services:
db:
deploy:
labels:
backupbot.backup: "true"
@ -24,17 +32,6 @@ v1:
backupbot.backup.post-hook: "rm -rf /tmp/dump/dump.db"
backupbot.backup.path: "/tmp/dump/"
```
v2:
```
deploy:
labels:
backupbot.backup: "true"
backupbot.backup.repos: "$some_thing"
backupbot.backup.at: "* * * * *"
backupbot.backup.post-hook: "rm -rf /tmp/dump/dump.db"
backupbot.backup.secrets": "db_root_password",
backupbot.backup.pre-hook: 'mysqldump -u root -p"$DB_ROOT_PASSWORD" -f /tmp/dump/dump.db'
```
## Questions: