From 572c9bc4bbc002700fc7eb49e638caeb3d47982c Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Tue, 20 Aug 2024 13:49:47 +0200 Subject: [PATCH] Add backup for wordpress Signed-off-by: Bensuperpc --- Makefile | 2 +- docker-compose.backup.yml | 32 -------------------------------- docker-compose.wordpress.yml | 21 ++++++++++++++++++++- env/backup.env | 5 +++-- 4 files changed, 24 insertions(+), 36 deletions(-) delete mode 100644 docker-compose.backup.yml diff --git a/Makefile b/Makefile index db6c66f..8257974 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ DOCKER := docker -PROFILES := caddy wordpress adminer backup syncthing uptime-kuma jellyfin qbittorrent psitransfer gitea +PROFILES := caddy wordpress adminer syncthing uptime-kuma jellyfin qbittorrent psitransfer gitea PROFILE_CMD := $(addprefix --profile ,$(PROFILES)) # gitea-runner watchtower transmission diff --git a/docker-compose.backup.yml b/docker-compose.backup.yml deleted file mode 100644 index e4039db..0000000 --- a/docker-compose.backup.yml +++ /dev/null @@ -1,32 +0,0 @@ -services: - # Backup - backup: - image: mazzolino/restic:latest - container_name: backup - profiles: - - backup - restart: on-failure:5 - env_file: - - env/backup.env - volumes: - - 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: - - no-new-privileges:true - -volumes: - backup: - name: backup \ No newline at end of file diff --git a/docker-compose.wordpress.yml b/docker-compose.wordpress.yml index 16391a6..f65b724 100644 --- a/docker-compose.wordpress.yml +++ b/docker-compose.wordpress.yml @@ -39,8 +39,27 @@ services: security_opt: - no-new-privileges:true + wordpress_backup: + image: mazzolino/restic:latest + container_name: wordpress_backup + profiles: + - wordpress + restart: on-failure:5 + env_file: + - env/backup.env + volumes: + - wordpress_backup:/mnt/restic + - wordpress_db:/data/wordpress_db:ro + - wordpress:/data/wordpress:ro + networks: + - infra-network + security_opt: + - no-new-privileges:true + volumes: wordpress_db: name: wordpress_db wordpress: - name: wordpress \ No newline at end of file + name: wordpress + wordpress_backup: + name: wordpress_backup \ No newline at end of file diff --git a/env/backup.env b/env/backup.env index 32ce056..d1131f2 100644 --- a/env/backup.env +++ b/env/backup.env @@ -1,8 +1,9 @@ +#RUN_ON_STARTUP=true BACKUP_CRON=0 * * * * 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_BACKUP_ARGS=--tag docker-volumes --verbose +RESTIC_FORGET_ARGS=--prune --keep-last 14 --keep-daily 7 --keep-weekly 5 --keep-monthly 12 --keep-yearly 2 #RESTIC_PRUNE_ARGS= RESTIC_CHECK_ARGS=--read-data-subset=20% \ No newline at end of file