diff --git a/roles/docker/tasks/gotosocial.yml b/roles/docker/tasks/gotosocial.yml index 6e0529a..c0fbbd9 100644 --- a/roles/docker/tasks/gotosocial.yml +++ b/roles/docker/tasks/gotosocial.yml @@ -4,6 +4,7 @@ state: directory loop: - /opt/stacks/gotosocial + - /opt/stacks/gotosocial/backup - name: Template out the compose file ansible.builtin.template: diff --git a/roles/docker/templates/gotosocial-compose.yml.j2 b/roles/docker/templates/gotosocial-compose.yml.j2 index 1af3f20..4389595 100644 --- a/roles/docker/templates/gotosocial-compose.yml.j2 +++ b/roles/docker/templates/gotosocial-compose.yml.j2 @@ -1,5 +1,3 @@ -version: "3.3" - services: gotosocial: image: superseriousbusiness/gotosocial:0.16.0 @@ -25,6 +23,22 @@ services: volumes: - gotosocial:/gotosocial/storage restart: "always" + labels: + - docker-volume-backup.stop-during-backup=true + + backup: + image: offen/docker-volume-backup:v2 + restart: always + environment: + BACKUP_FILENAME: backup-%Y-%m-%dT%H-%M-%S.tar.gz + BACKUP_LATEST_SYMLINK: backup-latest.tar.gz + BACKUP_CRON_EXPRESSION: "0 9 * * *" + BACKUP_PRUNING_PREFIX: backup- + BACKUP_RETENTION_DAYS: 1 + volumes: + - gotosocial:/backup/my-app-backup:ro + - /var/run/docker.sock:/var/run/docker.sock:ro + - ./backup:/archive volumes: gotosocial: