Update README.md
This commit is contained in:
parent
a5091db501
commit
36231da47f
54
README.md
54
README.md
|
@ -5,11 +5,18 @@
|
||||||
|
|
||||||
Backup using https://restic.net/ for a docker-compose setup.
|
Backup using https://restic.net/ for a docker-compose setup.
|
||||||
|
|
||||||
Automatically detects and backs up volumes in a docker-compose setup.
|
Automatically detects and backs up volumes, mysql, mariadb and postgres databases in a docker-compose setup.
|
||||||
This includes both host mapped volumes and actual docker volumes.
|
This includes both host mapped volumes and actual docker volumes.
|
||||||
|
|
||||||
|
* Each service in the compose setup is configured with a label
|
||||||
|
to enable backup of volumes or databases
|
||||||
|
* When backup starts a new instance of the container is created
|
||||||
|
mapping in all the needed volumes. It will copy networks etc
|
||||||
|
to ensure databases can be reached
|
||||||
|
* Volumes are mounter to `/backup/<service_name>/<path>`
|
||||||
|
in the backup process container. `/backup` is pushed into restic
|
||||||
|
* Databases are backed up from stdin / dumps
|
||||||
* Cron triggers backup
|
* Cron triggers backup
|
||||||
* Volumes for all running containers are backed up
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
|
@ -22,11 +29,12 @@ RESTIC_PASSWORD
|
||||||
|
|
||||||
Backend specific env vars : https://restic.readthedocs.io/en/stable/040_backup.html#environment-variables
|
Backend specific env vars : https://restic.readthedocs.io/en/stable/040_backup.html#environment-variables
|
||||||
|
|
||||||
Example compose setup:
|
### Volumes
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: '3'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
|
# The backup service
|
||||||
backup:
|
backup:
|
||||||
build: restic-volume-backup
|
build: restic-volume-backup
|
||||||
environment:
|
environment:
|
||||||
|
@ -36,6 +44,7 @@ services:
|
||||||
- some_other_vars.env
|
- some_other_vars.env
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||||
|
|
||||||
example:
|
example:
|
||||||
image: some_image
|
image: some_image
|
||||||
# Enable volume backup with label
|
# Enable volume backup with label
|
||||||
|
@ -52,7 +61,7 @@ volumes:
|
||||||
media:
|
media:
|
||||||
```
|
```
|
||||||
|
|
||||||
Include
|
A simple `include` and `exclude` filter is also available.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
example:
|
example:
|
||||||
|
@ -73,7 +82,7 @@ volumes:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Exclude:
|
Exclude
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
example:
|
example:
|
||||||
|
@ -93,6 +102,34 @@ volumes:
|
||||||
files:
|
files:
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Databases
|
||||||
|
|
||||||
|
Will dump databases directly into restic through stdin.
|
||||||
|
They will appear in restic as a separate snapshot with
|
||||||
|
path `/backup/<service_name>/dump.sql` or similar.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
mariadb:
|
||||||
|
image: mariadb:10
|
||||||
|
labels:
|
||||||
|
restic-volume-backup.mariadb: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
mysql:
|
||||||
|
image: mysql:5
|
||||||
|
labels:
|
||||||
|
restic-volume-backup.mysql: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
postgres:
|
||||||
|
image: postgres
|
||||||
|
labels:
|
||||||
|
restic-volume-backup.postgres: true
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Running Tests
|
## Running Tests
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -100,10 +137,3 @@ python setup.py develop
|
||||||
pip install -r tests/requirements.txt
|
pip install -r tests/requirements.txt
|
||||||
pytest tests
|
pytest tests
|
||||||
```
|
```
|
||||||
|
|
||||||
## TEMP
|
|
||||||
|
|
||||||
```
|
|
||||||
mysql://user:pw@host:port/dbname
|
|
||||||
postgresql://user:pw@host:port/dbname
|
|
||||||
```
|
|
||||||
|
|
Loading…
Reference in New Issue