From a141daff08f491d0b703dc291a49e026b4b92395 Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Sat, 18 May 2024 18:07:56 +0200 Subject: [PATCH] Add restic backup Signed-off-by: Bensuperpc --- Makefile | 4 +++- docker-compose.backup.yml | 29 ++++++++++++++--------------- docker-compose.networks.yml | 2 -- docker-compose.volumes.yml | 2 -- env/backup.env | 12 ++++++++---- 5 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index 3090d29..2261cab 100644 --- a/Makefile +++ b/Makefile @@ -13,9 +13,11 @@ DOCKER := docker -PROFILES := caddy wordpress adminer uptime-kuma qbittorrent jellyfin watchtower backup syncthing openssh gitea gitea-runner +PROFILES := caddy wordpress adminer backup qbittorrent PROFILE_CMD := $(addprefix --profile ,$(PROFILES)) +# syncthing openssh gitea gitea-runner uptime-kuma jellyfin watchtower + COMPOSE_FILES := $(shell find docker-compose*.yml | sed -e 's/^/--file /') .PHONY: build all diff --git a/docker-compose.backup.yml b/docker-compose.backup.yml index 33a1c07..294ca20 100644 --- a/docker-compose.backup.yml +++ b/docker-compose.backup.yml @@ -1,7 +1,7 @@ services: # Backup backup: - image: offen/docker-volume-backup:latest + image: mazzolino/restic:latest container_name: backup profiles: - backup @@ -9,20 +9,19 @@ services: env_file: - env/backup.env volumes: - - /var/run/docker.sock:/var/run/docker.sock:ro - - backup:/archive - - caddy_data:/backup/caddy_data:ro - - caddy_config:/backup/caddy_config:ro -# - gitea_data:/backup/gitea_data:ro -# - gitea_config:/backup/gitea_config:ro -# - wordpress_db:/backup/wordpress_db:ro -# - wordpress:/backup/wordpress:ro -# - jellyfin_config:/backup/jellyfin_config:ro -# - jellyfin_data:/backup/jellyfin_data:ro -# - jellyfin_cache:/backup/jellyfin_cache:ro -# - qbittorrent_config:/backup/qbittorrent_config:ro -# - qbittorrent_data:/backup/qbittorrent_data:ro -# - uptimekuma_data:/backup/uptimekuma_data:ro + - backup:/mnt/restic + - caddy_data:/data/caddy_data:ro +# - caddy_config:/data/caddy_config:ro +# - gitea_data:/data/gitea_data:ro +# - gitea_config:/data/gitea_config:ro +# - wordpress_db:/data/wordpress_db:ro +# - wordpress:/data/wordpress:ro +# - jellyfin_config:/data/jellyfin_config:ro +# - jellyfin_data:/data/jellyfin_data:ro +# - jellyfin_cache:/data/jellyfin_cache:ro +# - qbittorrent_config:/data/qbittorrent_config:ro +# - qbittorrent_data:/data/qbittorrent_data:ro +# - uptimekuma_data:/data/uptimekuma_data:ro networks: - infra-network security_opt: diff --git a/docker-compose.networks.yml b/docker-compose.networks.yml index a073dca..8e8c41b 100644 --- a/docker-compose.networks.yml +++ b/docker-compose.networks.yml @@ -1,5 +1,3 @@ -version: '3.9' - networks: infra-network: driver: bridge diff --git a/docker-compose.volumes.yml b/docker-compose.volumes.yml index 148375a..a47a3b5 100644 --- a/docker-compose.volumes.yml +++ b/docker-compose.volumes.yml @@ -1,5 +1,3 @@ -version: '3.9' - volumes: uptimekuma_data: name: uptimekuma_data diff --git a/env/backup.env b/env/backup.env index 985ec6d..138647a 100644 --- a/env/backup.env +++ b/env/backup.env @@ -1,4 +1,8 @@ -BACKUP_COMPRESSION="zst" -BACKUP_CRON_EXPRESSION="0 2 * * *" -# BACKUP_RETENTION_DAYS: '7' -# BACKUP_FILENAME="backup-%Y-%m-%dT%H-%M-%S.{{ .Extension }}" \ No newline at end of file +BACKUP_CRON=0 2 * * * +RESTIC_REPOSITORY=/mnt/restic +RESTIC_BACKUP_SOURCES=/data +RESTIC_PASSWORD=7L1Ncbquax0B2TCOmrjaQl9n5mnY88bQ +#RESTIC_BACKUP_ARGS= +#RESTIC_FORGET_ARGS=--prune --keep-last 14 --keep-daily 1 +#RESTIC_PRUNE_ARGS= +RESTIC_CHECK_ARGS=--read-data-subset=20% \ No newline at end of file