mirror of
https://github.com/mykitserver/docker-limesurvey.git
synced 2025-12-07 08:59:23 +01:00
Add socket check before waiting for database connection
database connection checking with netcat is only possible when using a TCP/IP connection, just launch the application when the user chooses a unix socket
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
DB_TYPE=${DB_TYPE:-'mysql'}
|
||||
DB_HOST=${DB_HOST:-'mysql'}
|
||||
DB_PORT=${DB_PORT:-'3306'}
|
||||
DB_SOCK=${DB_SOCK:-}
|
||||
DB_NAME=${DB_NAME:-'limesurvey'}
|
||||
DB_TABLE_PREFIX=${DB_TABLE_PREFIX:-'lime_'}
|
||||
DB_USERNAME=${DB_USERNAME:-'limesurvey'}
|
||||
@@ -20,11 +21,13 @@ URL_FORMAT=${URL_FORMAT:-'path'}
|
||||
|
||||
|
||||
# Check if database is available
|
||||
until nc -z -v -w30 $DB_HOST $DB_PORT
|
||||
do
|
||||
echo "Info: Waiting for database connection..."
|
||||
sleep 5
|
||||
done
|
||||
if [ -z "$DB_SOCK" ]; then
|
||||
until nc -z -v -w30 $DB_HOST $DB_PORT
|
||||
do
|
||||
echo "Info: Waiting for database connection..."
|
||||
sleep 5
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Check if already provisioned
|
||||
|
||||
Reference in New Issue
Block a user