diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b79b05e..1d6b5d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -309,9 +309,14 @@ jobs: docker compose --env-file .env.example build api docker compose --env-file .env.example up -d api + # In containerized runners (Gitea DinD), 127.0.0.1 of the job + # is not the Docker daemon host. Probe the production API from + # inside its own container so this barrier works on GitHub and Gitea. api_ready=0 for _ in $(seq 1 30); do - if curl -fsS http://127.0.0.1:3101/api/v3/health >/tmp/dhv2-health.json 2>/dev/null; then + if docker compose --env-file .env.example exec -T api \ + node -e 'fetch(`http://127.0.0.1:${process.env.API_PORT}/api/v3/health`).then(async r => { const t = await r.text(); process.stdout.write(t); if (!r.ok) process.exit(1); }).catch(() => process.exit(1))' \ + >/tmp/dhv2-health.json 2>/dev/null; then api_ready=1 break fi