Commit 1cdcb290 authored by Daniel LACROIX's avatar Daniel LACROIX
Browse files

wait for DB to be up before starting

parent ee8bbb01
#!/bin/sh
set -e
REPLACE_VARS='DB_PASSWORD APIKEY'
# check if needed vars are present
......@@ -15,6 +14,20 @@ fi
envsubst "$(printf '${%s} ' $REPLACE_VARS)" < /app/settings.json.tmpl > /app/settings.json
echo $APIKEY > /app/APIKEY.txt
# wait for DB if needed
loop_count=0
success=0
while [[ $loop_count -lt 10 ]] && [[ $success != 1 ]]; do
nc -z db 3306
if [[ $? -eq 0 ]]; then
success=1
else
sleep 5s
loop_count=$((loop_count+1))
fi
done
set -e
nginx
node node_modules/ep_etherpad-lite/node/server.js
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment