-
Notifications
You must be signed in to change notification settings - Fork 112
/
docker-compose.yaml
40 lines (38 loc) · 939 Bytes
/
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
services:
mariadb:
image: mariadb:10.11
container_name: my_mariadb
security_opt:
- seccomp:unconfined
expose:
- 3306
volumes:
- data:/var/lib/mysql
- ${VOLUME_PATH}/backup:/backup
environment:
- MYSQL_DATABASE=${DATABASE_NAME}
- MYSQL_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD}
- MYSQL_ALLOW_EMPTY_ROOT_PASSWORD=yes
restart: unless-stopped
healthcheck:
test: [ "CMD", "healthcheck.sh", "--su-mysql", "--connect" ]
timeout: 5s
retries: 10
backup:
build: .
image: fradelg/mysql-cron-backup
depends_on:
mariadb:
condition: service_healthy
volumes:
- ${VOLUME_PATH}/backup:/backup
environment:
- MYSQL_HOST=my_mariadb
- MYSQL_USER=root
- MYSQL_PASS=${MARIADB_ROOT_PASSWORD}
- MAX_BACKUPS=1
- INIT_BACKUP=1
- CRON_TIME=0 0 * * *
restart: unless-stopped
volumes:
data: