Skip to content

Commit

Permalink
Get MYSQL_HOST and MYSQL_PORT from environment var for docker-entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
xcompass committed Jan 22, 2024
1 parent a897540 commit d073175
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit d073175

Please sign in to comment.