Add Borgmatic backup

This commit is contained in:
2025-12-09 02:45:07 +03:30
parent f9d16ab078
commit 9ad4da8fe0
4 changed files with 216 additions and 0 deletions

50
backup/borgmatic.yml Normal file
View File

@@ -0,0 +1,50 @@
---
services:
borgmatic:
image: ghcr.io/borgmatic-collective/borgmatic:latest
container_name: borgmatic
restart: unless-stopped
environment:
TZ: ${TIMEZONE:-UTC}
BORG_PASSPHRASE: ${BORG_PASSPHRASE}
BORG_RELOCATED_REPO_ACCESS_IS_OK: "yes"
# PostgreSQL connection
PGHOST: postgres
PGPORT: "5432"
PGUSER: ${POSTGRES_ADMIN_USER}
PGPASSWORD: ${POSTGRES_ADMIN_PASSWORD}
volumes:
# Borgmatic configuration
- ./config/borgmatic:/etc/borgmatic.d:ro
# Borg repository storage
- ${BORG_REPO_DIR:-borg-repo}:/borg/repo
# Named volumes to backup (read-only)
- opencloud-config:/source/opencloud-config:ro
- opencloud-data:/source/opencloud-data:ro
- gitea_data:/source/gitea_data:ro
- odoo-db-data:/source/odoo-db-data:ro
- odoo-config:/source/odoo-config:ro
# PostgreSQL dumps directory
- borgmatic-pgdumps:/source/pgdumps
# Borg cache and state
- borgmatic-cache:/root/.cache/borg
- borgmatic-state:/root/.borgmatic
labels:
- "traefik.enable=false"
volumes:
opencloud-config:
external: true
opencloud-data:
external: true
gitea_data:
external: true
odoo-db-data:
external: true
odoo-config:
external: true
borg-repo:
borgmatic-pgdumps:
borgmatic-cache:
borgmatic-state: