From 32aea6e1a68b62ae0301650b8ca25c870c704dcd Mon Sep 17 00:00:00 2001 From: Vadym Samoilenko Date: Thu, 19 Mar 2026 21:02:40 +0000 Subject: [PATCH] Fix deploy: wait up to 2min for Next.js frontend to start before health check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- deploy.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index 0d87f39..564199e 100755 --- a/deploy.sh +++ b/deploy.sh @@ -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'"