From d073175b83a56a6be48008f2bb6040bc4761e79a Mon Sep 17 00:00:00 2001 From: Pan Luo Date: Mon, 22 Jan 2024 13:27:24 -0800 Subject: [PATCH] Get MYSQL_HOST and MYSQL_PORT from environment var for docker-entrypoint --- docker/docker-entrypoint.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 791e0798d..f626c2af7 100644 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -1,8 +1,10 @@ #!/bin/sh set -e +MYSQL_PORT="${MYSQL_PORT:-3306}" + wait_for_mysql() { - until nc -z -v -w30 "mysql" "3306"; do + until nc -z -v -w30 "$MYSQL_HOST" "$MYSQL_PORT"; do echo "Waiting for MySQL to be ready..." sleep 2 done