зеркало из https://github.com/mozilla/treeherder.git
19 строки
499 B
Bash
Executable File
19 строки
499 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# This file is the entrypoint for the backend container.
|
|
# It takes care of making sure to wait for the mysql container to be ready
|
|
|
|
# Make non-zero exit codes & other errors fatal.
|
|
set -euo pipefail
|
|
|
|
# Keep these in sync with DATABASE_URL.
|
|
DATABASE_HOST='mysql'
|
|
DATABASE_PORT='3306'
|
|
|
|
while ! nc -z "${DATABASE_HOST}" "${DATABASE_PORT}" &> /dev/null; do
|
|
echo '-----> Waiting for MySQL server to be ready'
|
|
sleep 1;
|
|
done
|
|
echo '-----> MySQL service is available'
|
|
|
|
exec "$@"
|