feat(docker): wait for backend host to resolve before start
All checks were successful
CI / Get Changed Files (pull_request) Successful in 8s
CI / Checkstyle Main (pull_request) Has been skipped
CI / prettier (pull_request) Successful in 47s
CI / eslint (pull_request) Successful in 52s
CI / test-build (pull_request) Successful in 57s

This commit is contained in:
csimonis 2025-04-24 14:48:40 +02:00
parent 69b0289ce4
commit 9a901154b6

View file

@ -3,5 +3,11 @@
: ${BACKEND_HOST:=localhost}
: ${BACKEND_PORT:=8080}
# Wait until the backend host is resolvable
echo "Waiting for backend host $BACKEND_HOST..."
until getent hosts "$BACKEND_HOST" > /dev/null; do
sleep 1
done
envsubst '$BACKEND_HOST $BACKEND_PORT' < /etc/nginx/templates/nginx.conf.template > /etc/nginx/conf.d/default.conf
exec nginx -g 'daemon off;'