This repository contains Restic – a fast, secure, efficient backup program.
Make sure that the Base is already set up and started.
Clone the code to your server:
git clone git@gitlab.com:hueske-digital/services/backups.git ~/services/backups
Create environment file and fill up with your values:
cd ~/services/backups && cp .env.example .env && vim .env
Pull images and start the compose file:
docker compose up -d
Add the following label to all containers which should be backuped:
labels:
backups: "true"
To work with your backups check out this project and make sure that your .env
file is configured according to your existing backups.
docker compose exec backup backup
Execute this in this projects directory to see all existing snapshots:
docker compose exec backup restic snapshots
Execute this in this projects directory to restore the home dir:
docker compose exec backup restic restore --include /mnt/home --target / <SNAPSHOT ID>
If your user changed, you might have to adjust the user rights afterwards.
Execute this in this projects directory to restore a docker volume:
docker compose exec backup restic restore --include /mnt/volumes/name_of_volume --target / <SNAPSHOT ID>
The --include
parameter can be repeated several times to restore multiple volumes at once.
Update all container images and recreate them if new images are available:
docker compose pull && docker compose up -d
Restart a single container:
docker compose restart app
Shutdown all container of this compose file:
docker compose down
Show and follow logs:
docker compose logs -ft
Additional configuration:
You can include any other docker config by using an additional compose file.