restic-compose-backup/docker-compose.yaml

66 lines
1.4 KiB
YAML
Raw Normal View History

2019-04-15 15:04:16 +00:00
version: '3'
services:
backup:
build: .
env_file:
2019-12-03 08:40:02 +00:00
- restic_compose_backup.env
2019-04-15 15:04:16 +00:00
volumes:
2019-04-15 16:30:49 +00:00
# Map in docker socket
2019-04-15 15:04:16 +00:00
- /var/run/docker.sock:/tmp/docker.sock:ro
2019-11-26 19:00:54 +00:00
# Map backup database locally
- ./restic_data:/restic_data
- ./restic_cache:/cache
# Map in project source in dev
2019-12-03 08:40:02 +00:00
- .:/restic-compose-backup
web:
image: nginx
labels:
2019-12-03 08:40:02 +00:00
restic-compose-backup.volumes: true
restic-compose-backup.volumes.include: "/tests"
volumes:
- ./tests:/srv/tests
- ./.vscode:/srv/code
2019-04-19 04:34:33 +00:00
environment:
- SOME_VALUE=test
- ANOTHER_VALUE=1
2019-12-02 20:31:35 +00:00
2019-04-19 04:34:33 +00:00
mysql:
2019-11-29 04:35:55 +00:00
image: mysql:5
2019-04-19 04:34:33 +00:00
labels:
2019-12-03 08:40:02 +00:00
restic-compose-backup.mysql: true
2019-04-19 04:34:33 +00:00
environment:
- MYSQL_ROOT_PASSWORD=my-secret-pw
- MYSQL_DATABASE=mydb
- MYSQL_USER=myuser
- MYSQL_PASSWORD=mypassword
volumes:
- mysqldata:/var/lib/mysql
2019-12-02 20:31:35 +00:00
mariadb:
image: mariadb:10
labels:
2019-12-03 08:40:02 +00:00
restic-compose-backup.mariadb: true
2019-12-02 20:31:35 +00:00
environment:
- MYSQL_ROOT_PASSWORD=my-secret-pw
- MYSQL_DATABASE=mydb
- MYSQL_USER=myuser
- MYSQL_PASSWORD=mypassword
volumes:
- mariadbdata:/var/lib/mysql
2019-12-03 00:40:30 +00:00
postgres:
2019-12-03 05:21:51 +00:00
image: postgres:11
2019-12-03 00:40:30 +00:00
labels:
2019-12-03 08:40:02 +00:00
restic-compose-backup.postgres: true
2019-12-03 00:40:30 +00:00
environment:
- POSTGRES_USER=pguser
- POSTGRES_PASSWORD=pgpassword
- POSTGRES_DB=test
volumes:
- pgdata:/var/lib/postgresql/data
2019-04-19 04:34:33 +00:00
volumes:
2019-11-12 11:10:19 +00:00
mysqldata:
2019-12-03 00:40:30 +00:00
mariadbdata:
pgdata: