restic-compose-backup/docker-compose.yaml

91 lines
2.0 KiB
YAML
Raw Permalink Normal View History

version: '3.7'
2019-04-15 15:04:16 +00:00
services:
backup:
build: ./src
2019-04-15 15:04:16 +00:00
env_file:
2019-12-03 08:40:02 +00:00
- restic_compose_backup.env
# - alerts.env
2019-12-10 06:57:37 +00:00
labels:
restic-compose-backup.volumes: true
restic-compose-backup.volumes.include: 'src'
networks:
- default
- global
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-12-06 09:53:51 +00:00
# Map local restic repository for dev
2019-11-26 19:00:54 +00:00
- ./restic_data:/restic_data
2019-12-06 09:53:51 +00:00
# Map restic cache
- ./restic_cache:/cache
# Map in project source in dev
- ./src:/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:
- ./src/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
mysql5:
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:
- mysqldata5:/var/lib/mysql
mysql8:
image: mysql:8
labels:
restic-compose-backup.mysql: true
environment:
- MYSQL_ROOT_PASSWORD=my-secret-pw
- MYSQL_DATABASE=mydb
- MYSQL_USER=myuser
- MYSQL_PASSWORD=mypassword
volumes:
- mysqldata8:/var/lib/mysql
2019-04-19 04:34:33 +00:00
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:
mysqldata5:
mysqldata8:
2019-12-03 00:40:30 +00:00
mariadbdata:
pgdata:
networks:
global:
external: true