mirror of
https://github.com/fradelg/docker-mysql-cron-backup.git
synced 2024-11-01 00:21:46 +01:00
add health check
This commit is contained in:
parent
07213e8135
commit
a715b4946c
1 changed files with 9 additions and 2 deletions
|
@ -2,6 +2,7 @@ version: "2"
|
|||
services:
|
||||
mariadb:
|
||||
image: mariadb:10
|
||||
container_name: my_mariadb
|
||||
expose:
|
||||
- 3306
|
||||
volumes:
|
||||
|
@ -10,17 +11,23 @@ services:
|
|||
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
|
||||
mariadb:
|
||||
condition: service_healthy
|
||||
volumes:
|
||||
- ${VOLUME_PATH}/backup:/backup
|
||||
environment:
|
||||
- MYSQL_HOST=mariadb
|
||||
- MYSQL_HOST=my_mariadb
|
||||
- MYSQL_USER=root
|
||||
- MYSQL_PASS=${MARIADB_ROOT_PASSWORD}
|
||||
- MAX_BACKUPS=1
|
||||
|
|
Loading…
Reference in a new issue