Fix deploy: wait up to 2min for Next.js frontend to start before health check

Next.js SSR takes 30-60s to compile on first boot — immediate curl check
always fails. Now retries every 5s for up to 24 attempts (2 minutes).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vadym Samoilenko 2026-03-19 21:02:40 +00:00
parent f02b8a0b30
commit 32aea6e1a6

View file

@ -282,7 +282,15 @@ else
FAIL=1
fi
if curl -sf "http://127.0.0.1:${WEB_PORT}/ppt-tool/" > /dev/null; then
info " Waiting for frontend to be ready (Next.js takes ~30-60s to start)..."
WEB_OK=0
for i in $(seq 1 24); do
if curl -sf "http://127.0.0.1:${WEB_PORT}/ppt-tool/" > /dev/null 2>&1; then
WEB_OK=1; break
fi
sleep 5
done
if [ "$WEB_OK" -eq 1 ]; then
info " Frontend (port ${WEB_PORT}): OK"
else
warn " Frontend (port ${WEB_PORT}): not responding — check 'docker compose logs web'"