Compare commits

...

1 Commits

Author SHA1 Message Date
p4u1 ac974a4631 add backup config
continuous-integration/drone/push Build is passing Details
2024-05-03 14:49:08 +02:00
1 changed files with 8 additions and 0 deletions

View File

@ -53,6 +53,14 @@ services:
retries: 6
volumes:
- "postgres_data:/var/lib/postgresql/data"
deploy:
labels:
backupbot.backup: "true"
backupbot.backup.pre-hook: sh -c 'pg_dump -U "$$POSTGRES_USER" -Fc "$$POSTGRES_DB" | gzip > "/postgres.dump.gz"'
backupbot.backup.path: "/postgres.dump.gz"
backupbot.backup.post-hook: "rm -f /postgres.dump.gz"
backupbot.restore: "true"
backupbot.restore.post-hook: sh -c 'gzip -d /postgres.dump.gz && pg_restore --clean -U "$$POSTGRES_USER" --dbname="$$POSTGRES_DB" < /postgres.dump && rm -f /postgres.dump'
secrets:
db_password: