mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +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:
parent
d472fd4fa6
commit
ec8523ce75
1 changed files with 7 additions and 1 deletions
|
@ -24,6 +24,11 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./docker/production/data/mysql:/var/lib/mysql
|
- ./docker/production/data/mysql:/var/lib/mysql
|
||||||
command: --authentication-policy=mysql_native_password
|
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:
|
prepare_backend:
|
||||||
build:
|
build:
|
||||||
|
@ -32,7 +37,8 @@ services:
|
||||||
DOCKER_USER_UID: ${DOCKER_USER_UID:?Missing DOCKER_USER_UID}
|
DOCKER_USER_UID: ${DOCKER_USER_UID:?Missing DOCKER_USER_UID}
|
||||||
DOCKER_USER_GID: ${DOCKER_USER_GID:?Missing DOCKER_USER_GID}
|
DOCKER_USER_GID: ${DOCKER_USER_GID:?Missing DOCKER_USER_GID}
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql
|
mysql:
|
||||||
|
condition: service_healthy
|
||||||
volumes:
|
volumes:
|
||||||
- ./:/zeppelin
|
- ./:/zeppelin
|
||||||
command: |-
|
command: |-
|
||||||
|
|
Loading…
Add table
Reference in a new issue