forked from ZettaIO/restic-compose-backup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
77 lines (72 loc) · 1.69 KB
/
docker-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
version: '3.7'
services:
backup:
build: ./src
env_file:
- restic_compose_backup.env
- alerts.env
labels:
restic-compose-backup.volumes: true
restic-compose-backup.volumes.include: 'src'
networks:
- default
- global
volumes:
# Map in docker socket
- /var/run/docker.sock:/tmp/docker.sock:ro
# Map local restic repository for dev
- ./restic_data:/restic_data
# Map restic cache
- ./restic_cache:/cache
# Map in project source in dev
- ./src:/restic-compose-backup
web:
image: nginx
labels:
restic-compose-backup.volumes: true
restic-compose-backup.volumes.include: "/tests"
volumes:
- ./src/tests:/srv/tests
- ./.vscode:/srv/code
environment:
- SOME_VALUE=test
- ANOTHER_VALUE=1
mysql:
image: mysql:5
labels:
restic-compose-backup.mysql: true
environment:
- MYSQL_ROOT_PASSWORD=my-secret-pw
- MYSQL_DATABASE=mydb
- MYSQL_USER=myuser
- MYSQL_PASSWORD=mypassword
volumes:
- mysqldata:/var/lib/mysql
mariadb:
image: mariadb:10
labels:
restic-compose-backup.mariadb: true
environment:
- MYSQL_ROOT_PASSWORD=my-secret-pw
- MYSQL_DATABASE=mydb
- MYSQL_USER=myuser
- MYSQL_PASSWORD=mypassword
volumes:
- mariadbdata:/var/lib/mysql
postgres:
image: postgres:11
labels:
restic-compose-backup.postgres: true
environment:
- POSTGRES_USER=pguser
- POSTGRES_PASSWORD=pgpassword
- POSTGRES_DB=test
volumes:
- pgdata:/var/lib/postgresql/data
volumes:
mysqldata:
mariadbdata:
pgdata:
networks:
global:
external: true