3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-14 21:31:50 +00:00

fix(docker): add mysql container health check

This makes the prepare_backend container (which runs migrations) wait
until the mysql server is actually running, not just the container.

Thanks to Skyz on Discord for the implementation.
This commit is contained in:
Dragory 2022-08-13 23:23:44 +03:00
parent d472fd4fa6
commit ec8523ce75
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -24,6 +24,11 @@ services:
volumes:
- ./docker/production/data/mysql:/var/lib/mysql
command: --authentication-policy=mysql_native_password
healthcheck:
test: "/usr/bin/mysql --user=root --password=\"${DOCKER_PROD_MYSQL_ROOT_PASSWORD}\" --execute \"SHOW DATABASES;\""
interval: 5s
timeout: 300s
retries: 60
prepare_backend:
build:
@ -32,7 +37,8 @@ services:
DOCKER_USER_UID: ${DOCKER_USER_UID:?Missing DOCKER_USER_UID}
DOCKER_USER_GID: ${DOCKER_USER_GID:?Missing DOCKER_USER_GID}
depends_on:
- mysql
mysql:
condition: service_healthy
volumes:
- ./:/zeppelin
command: |-