From 3a9850cafb5b57398d75a5f7b871dda879673c58 Mon Sep 17 00:00:00 2001 From: Zhi Date: Sat, 14 Mar 2026 07:45:23 +0000 Subject: [PATCH] Use docker network for health check --- run-test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run-test.sh b/run-test.sh index a4d42e1..51b0bfa 100755 --- a/run-test.sh +++ b/run-test.sh @@ -13,11 +13,11 @@ docker compose -f "$COMPOSE_FILE" down 2>/dev/null || true echo "📦 Starting services..." docker compose -f "$COMPOSE_FILE" up -d -# Wait for frontend to be ready +# Wait for frontend to be ready (run curl inside docker network) echo "⏳ Waiting for services..." MAX_RETRIES=30 RETRY_COUNT=0 -until curl -s -o /dev/null -w "%{http_code}" http://frontend:3000/ | grep -q "200" || [ $RETRY_COUNT -eq $MAX_RETRIES ]; do +until docker run --rm --network harborforgetest_test-network curlimages/curl -s -o /dev/null -w "%{http_code}" http://frontend:3000/ 2>/dev/null | grep -q "200" || [ $RETRY_COUNT -eq $MAX_RETRIES ]; do echo " Waiting for frontend... ($RETRY_COUNT/$MAX_RETRIES)" sleep 2 RETRY_COUNT=$((RETRY_COUNT+1))