From eb2686548274c3261a2d3479a0895b784b3213bd Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sun, 2 Jun 2024 13:24:32 +0100 Subject: [PATCH] Make exmaple compose file self-sufficient --- config/default.env | 1 - docker-compose.yml | 17 ++++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) delete mode 100644 config/default.env diff --git a/config/default.env b/config/default.env deleted file mode 100644 index 9a8dad1..0000000 --- a/config/default.env +++ /dev/null @@ -1 +0,0 @@ -PASSWORD=my_password diff --git a/docker-compose.yml b/docker-compose.yml index 88a553f..da63e30 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,31 +1,30 @@ services: backup: + image: ghcr.io/schmelczer/backup-container:latest container_name: backup init: true tty: true - build: - context: . environment: - TZ=Europe/London - SLEEP_TIME=1h # we will wait an hour between backups # first backup goes to rsync.net - - BORG_PASSPHRASE_0=$PASSWORD + - BORG_PASSPHRASE_0=MY_PASSWORD_CHANGE_THIS - BORG_REMOTE_PATH_0=borg1 # we must use this executable in the rsync.net host - - BORG_REPO_0=my-username@my-username.rsync.net:~/backup + - BORG_REPO_0=change-this-username@change-this-username.rsync.net:~/backup # second backup goes to a local path - - BORG_PASSPHRASE_1=$PASSWORD + - BORG_PASSPHRASE_1=MY_PASSWORD_CHANGE_THIS - BORG_REPO_1=/local-backup # the following are passed to `borg prune` - KEEP_DAILY=6 # default: 6 - KEEP_WEEKLY=3 # default: 3 - KEEP_MONTHLY=48 # default: 48 - - KEEP_YEARLY=10 # default: 0 + - KEEP_YEARLY=10 # default: 0 (!) volumes: - - /volumes:/source:ro # we will backup this folder, we mustn't change it, so it's readonly - - /volumes/backup:/snapshot # we must mount a btrfs path for the snapshot to be put at, this is just a temporary path + - /volumes:/source:ro # we backup this folder (which is a BTRFS volume), we mustn't change it, so it's readonly + - /volumes/backup:/snapshot # we must mount a path to a folder on the BTRFS disk for the snapshot to be put at, this is just a temporary path - /volumes/backup/logs:/backup-logs # we will store the output of the backup commands in this folder - borg-cache:/root/.cache/borg # speed up subsequent backups @@ -33,7 +32,7 @@ services: - /volumes/backup/config/id_rsa:/root/.ssh/id_rsa # this is an example for mounting an ssh key for a remote repo (BORG_REPO_0 above) cap_add: - - SYS_ADMIN # we need this capability to snapshot a btrfs volume + - SYS_ADMIN # we need this capability to snapshot a BTRFS volume restart: unless-stopped volumes: