2022-12-07 02:42:58 +01:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
set +e
|
|
|
|
|
|
|
|
waitForService()
|
|
|
|
{
|
2022-12-17 06:31:35 +01:00
|
|
|
wait-for-it.sh $1 -t 2 1>/dev/null 2>&1
|
2022-12-07 02:42:58 +01:00
|
|
|
status=$?
|
|
|
|
while [ $status != 0 ]
|
|
|
|
do
|
|
|
|
echo "[x] wating for $1..."
|
|
|
|
sleep 1
|
2022-12-17 06:31:35 +01:00
|
|
|
wait-for-it.sh $1 -t 2 1>/dev/null 2>&1
|
2022-12-07 02:42:58 +01:00
|
|
|
status=$?
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2024-07-19 21:51:16 +02:00
|
|
|
waitForService "postgres-db:5432"
|
|
|
|
waitForService "api-logger:24224"
|
2022-12-07 02:42:58 +01:00
|
|
|
|
2022-12-17 06:31:35 +01:00
|
|
|
# run migrations
|
|
|
|
migrate.sh
|
2022-12-07 02:42:58 +01:00
|
|
|
|
|
|
|
exec "$@"
|