Fix: add retry loop for API health check (same as frontend)

API takes time to initialize — immediate curl always fails.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vadym Samoilenko 2026-03-19 21:27:41 +00:00
parent 5c052e718d
commit 40c22e8d47

View file

@ -300,7 +300,15 @@ info "Step 12: Verifying deployment..."
FAIL=0
if curl -sf "http://127.0.0.1:${API_PORT}/docs" > /dev/null; then
info " Waiting for API to be ready..."
API_OK=0
for i in $(seq 1 24); do
if curl -sf "http://127.0.0.1:${API_PORT}/docs" > /dev/null 2>&1; then
API_OK=1; break
fi
sleep 5
done
if [ "$API_OK" -eq 1 ]; then
info " API (port ${API_PORT}): OK"
else
warn " API (port ${API_PORT}): not responding — check 'docker compose logs api'"