Add automated DB backups for nextcloud

Will roll this out to everything else someday too!
This commit is contained in:
Jake Howard 2020-03-27 17:50:47 +00:00
parent 55eca663a9
commit ca3ed14973
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 16 additions and 0 deletions

View file

@ -12,6 +12,7 @@ services:
- ./backups:/backups - ./backups:/backups
- /srv/nextcloud-data/data/:/source/nextcloud:ro - /srv/nextcloud-data/data/:/source/nextcloud:ro
- /opt/gitea/repos/repositories:/source/repositories:ro - /opt/gitea/repos/repositories:/source/repositories:ro
- /scratch/db-backups:/source/db-backups:ro
restart: unless-stopped restart: unless-stopped
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"

View file

@ -33,6 +33,21 @@ services:
- POSTGRES_PASSWORD=nextcloud - POSTGRES_PASSWORD=nextcloud
- POSTGRES_USER=nextcloud - POSTGRES_USER=nextcloud
db-backups:
image: prodrigestivill/postgres-backup-local:12-alpine
restart: unless-stopped
volumes:
- /scratch/db-backups:/backups
depends_on:
- db
environment:
- POSTGRES_HOST=db
- POSTGRES_PASSWORD=nextcloud
- POSTGRES_USER=nextcloud
- POSTGRES_DB=nextcloud
- BACKUP_KEEP_MONTHS=1
- BACKUP_KEEP_WEEKS=1
redis: redis:
image: redis:5-alpine image: redis:5-alpine
restart: unless-stopped restart: unless-stopped