Add backups

This commit is contained in:
3wc 2022-11-25 21:53:43 -08:00
parent cd23e770e0
commit c2ba0d9cca
1 changed files with 8 additions and 1 deletions

View File

@ -39,6 +39,8 @@ services:
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
- "coop-cloud.${STACK_NAME}.version=0.2.0+0.162.0"
- "backupbot.backup=true"
- "backupbot.backup.path=/home/node/.n8n"
db:
image: postgres:11
@ -55,7 +57,12 @@ services:
volumes:
- 'postgresql_data:/var/lib/postgresql/data'
# - ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
deploy:
labels:
backupbot.backup: "true"
backupbot.backup.pre-hook: "bash -c 'PGPASSWORD=$$(cat $${POSTGRES_PASSWORD_FILE}) pg_dump -U $${POSTGRES_USER} $${POSTGRES_DB} > /tmp/backup.sql'"
backupbot.backup.post-hook: "rm -rf /tmp/backup.sql"
backupbot.backup.path: "/tmp/backup.sql"
secrets:
# db_non_root_password: