diff --git a/docker/is-available.sh b/docker/is-available.sh index a4e4fe8af..01c0ee979 100755 --- a/docker/is-available.sh +++ b/docker/is-available.sh @@ -3,9 +3,15 @@ WAIT_FOR_URL="$1" shift -while ! (curl -s $WAIT_FOR_URL | grep "Welcome"); do - echo "$WAIT_FOR_URL is unavailable yet - waiting for it to start" - sleep 10 +attempt=0 +while [ $attempt -le 180 ]; do + attempt=$(( $attempt + 1 )) + echo "# Waiting for all services to be up (attempt: $attempt) ..." + ping_api_gateway_result=`curl -s $WAIT_FOR_URL | grep "Welcome"` + if [ "$?" -eq "0" ]; then + sleep 2 # for warmup + echo "# All services are up!" + break + fi + sleep 2 done - -echo "$WAIT_FOR_URL is up. Proceeding to startup."