Skip to content

Honor a configurable port in the reusable Docker health check - #2308

Merged
felladrin merged 2 commits into
mainfrom
fix/ci-docker-healthcheck-port
Aug 5, 2026
Merged

Honor a configurable port in the reusable Docker health check#2308
felladrin merged 2 commits into
mainfrom
fix/ci-docker-healthcheck-port

Conversation

@felladrin

@felladrin felladrin commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Currently, the reusable Docker workflow hardcodes 7860 in both the readiness curl and the PLAYWRIGHT_BASE_URL, and the compose production ports mapping publishes to container port 7860 while the app actually binds PORT. So a non-default port silently breaks both sides: the health check polls a port nothing answers on and never sees the container ready, and the published mapping points at a dead container port. This PR does 2 things: the reusable workflow now takes a port input (default "7860") exposed as a job-level PORT, so docker compose up, the readiness curl, and the Playwright base URL all agree on the same port; and the compose ports mapping forwards the host port to the container's real port (${PORT:-7860}:${PORT:-7860}). With no input passed the behavior is identical to before (7860:7860), so this is purely a robustness fix. #2276 already fixed the same hardcode in the Dockerfile healthcheck; this closes the CI side.

Note: a job-level env: is needed rather than a per-step one, because docker compose up -d reads PORT from the environment too. And caller-side env: doesn't cross the workflow_call boundary, which is why the port arrives as a declared input.

How to test

  1. With PORT unset, run docker compose -f docker-compose.production.yml up -d and check that curl localhost:7860/status returns 200.
  2. Run it again with PORT=9000 docker compose -f docker-compose.production.yml up -d and check that curl localhost:9000/status returns 200 (this failed before the fix, since the old mapping pointed at container port 7860).
  3. Confirm the check-docker workflow passes on this branch, which covers the default-port path end-to-end.

Note: I couldn't run the Docker build locally in this session, so step 3 is what verified the container path (check-docker / Check Docker Container passed in 2m48s). Step 2 still needs a local run to confirm the override case.

@felladrin felladrin changed the title Use PORT env var in reusable Docker health check Honor a configurable port in the reusable Docker health check Aug 5, 2026
@felladrin
felladrin marked this pull request as ready for review August 5, 2026 01:59
@felladrin
felladrin merged commit 70bb686 into main Aug 5, 2026
7 checks passed
@felladrin
felladrin deleted the fix/ci-docker-healthcheck-port branch August 5, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI Docker health check hardcodes port 7860 instead of using PORT env var

1 participant