40 lines
901 B
YAML
40 lines
901 B
YAML
version: '3'
|
|
services:
|
|
backup:
|
|
build: .
|
|
env_file:
|
|
- restic_volume_backup.env
|
|
volumes:
|
|
# Map in docker socket
|
|
- /var/run/docker.sock:/tmp/docker.sock:ro
|
|
# Map backup database locally
|
|
- ./restic_data:/restic_data
|
|
- ./restic_cache:/restic_cache
|
|
# Map in project source
|
|
- .:/restic-volume-backup
|
|
web:
|
|
image: nginx
|
|
labels:
|
|
restic-volume-backup.volumes: true
|
|
restic-volume-backup.include: "/tests"
|
|
volumes:
|
|
- ./tests:/srv/tests
|
|
- ./.vscode:/srv/code
|
|
environment:
|
|
- SOME_VALUE=test
|
|
- ANOTHER_VALUE=1
|
|
mysql:
|
|
image: mysql
|
|
labels:
|
|
restic-volume-backup.mysql: true
|
|
environment:
|
|
- MYSQL_ROOT_PASSWORD=my-secret-pw
|
|
- MYSQL_DATABASE=mydb
|
|
- MYSQL_USER=myuser
|
|
- MYSQL_PASSWORD=mypassword
|
|
volumes:
|
|
- mysqldata:/var/lib/mysql
|
|
|
|
volumes:
|
|
mysqldata:
|