Add backup for wordpress

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
This commit is contained in:
Bensuperpc 2024-08-20 13:49:47 +02:00
parent 7989688e8f
commit 572c9bc4bb
4 changed files with 24 additions and 36 deletions

View File

@ -13,7 +13,7 @@
DOCKER := docker 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)) PROFILE_CMD := $(addprefix --profile ,$(PROFILES))
# gitea-runner watchtower transmission # gitea-runner watchtower transmission

View File

@ -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

View File

@ -39,8 +39,27 @@ services:
security_opt: security_opt:
- no-new-privileges:true - 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: volumes:
wordpress_db: wordpress_db:
name: wordpress_db name: wordpress_db
wordpress: wordpress:
name: wordpress name: wordpress
wordpress_backup:
name: wordpress_backup

5
env/backup.env vendored
View File

@ -1,8 +1,9 @@
#RUN_ON_STARTUP=true
BACKUP_CRON=0 * * * * BACKUP_CRON=0 * * * *
RESTIC_REPOSITORY=/mnt/restic RESTIC_REPOSITORY=/mnt/restic
RESTIC_BACKUP_SOURCES=/data RESTIC_BACKUP_SOURCES=/data
RESTIC_PASSWORD=7L1Ncbquax0B2TCOmrjaQl9n5mnY88bQ RESTIC_PASSWORD=7L1Ncbquax0B2TCOmrjaQl9n5mnY88bQ
#RESTIC_BACKUP_ARGS= RESTIC_BACKUP_ARGS=--tag docker-volumes --verbose
#RESTIC_FORGET_ARGS=--prune --keep-last 14 --keep-daily 1 RESTIC_FORGET_ARGS=--prune --keep-last 14 --keep-daily 7 --keep-weekly 5 --keep-monthly 12 --keep-yearly 2
#RESTIC_PRUNE_ARGS= #RESTIC_PRUNE_ARGS=
RESTIC_CHECK_ARGS=--read-data-subset=20% RESTIC_CHECK_ARGS=--read-data-subset=20%