Added wait-for-it.sh script

This commit is contained in:
PB
2022-12-07 02:42:58 +01:00
parent 653224943b
commit cff0644ccb
5 changed files with 202 additions and 2 deletions

25
bin/entrypoint.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env sh
set +e
waitForService()
{
./wait-for-it.sh $1 -t 2 1>/dev/null 2>&1
status=$?
while [ $status != 0 ]
do
echo "[x] wating for $1..."
sleep 1
./wait-for-it.sh $1 -t 2 1>/dev/null 2>&1
status=$?
done
}
waitForService "postgres-db:5432"
waitForService "api-logger:24224"
waitForService "api-registry:8500"
# waitForService "api-eventbus:5672"
set -euo pipefail
exec "$@"