From 3f5dd536d118479beaff37989de03203e452d987 Mon Sep 17 00:00:00 2001 From: Oskar Kapala Date: Tue, 2 Jun 2026 21:49:52 +0200 Subject: [PATCH] fix: smoke tests use localhost:8080 (port mapping creates ambiguous container IPs) --- deploy.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/deploy.sh b/deploy.sh index ae68da5..3d3068e 100755 --- a/deploy.sh +++ b/deploy.sh @@ -33,27 +33,29 @@ cd "$DEPLOY_DIR" git pull origin main docker compose up -d --build --remove-orphans -# ── 3. Smoke test ───────────────────────────────────────────────────────── +# ── 3. Smoke test via host port 8080 ────────────────────────────────────── # Host: ubuntu-4gb-hel1-1 +# Port mapping adds a second network to the container, making the IP list +# ambiguous — use localhost:8080 (published port) for all checks instead. echo "Waiting for container to be ready..." sleep 2 -CONTAINER_IP=$(docker inspect humanai-landing \ - --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}') +BASE="http://localhost:8080" smoke_check() { local path="$1" local expect="$2" - local url="http://${CONTAINER_IP}${path}" local body - body=$(curl -sf --max-time 5 "$url") || { + body=$(curl -sf --max-time 5 "${BASE}${path}") || { echo "FAIL GET ${path} — no response (curl exit $?)" + docker compose logs --tail=40 return 1 } if echo "$body" | grep -qF "$expect"; then echo "OK GET ${path} — found: ${expect}" else echo "FAIL GET ${path} — '${expect}' not in response" + docker compose logs --tail=40 return 1 fi } @@ -64,9 +66,7 @@ smoke_check "/" "hreflang" smoke_check "/" "mailto:oskar@gethumanai.com" smoke_check "/en/" "human review" -# ── 4. Host-port smoke test ─────────────────────────────────────────────── -# Host: ubuntu-4gb-hel1-1 -echo "Checking host port 8080..." +echo "Checking headers on localhost:8080..." if curl -fsS -I --max-time 5 http://localhost:8080; then echo "OK localhost:8080 — 200" else