Honor a configurable port in the reusable Docker health check - #2308
Merged
Conversation
felladrin
marked this pull request as ready for review
August 5, 2026 01:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, the reusable Docker workflow hardcodes
7860in both the readiness curl and thePLAYWRIGHT_BASE_URL, and the compose productionportsmapping publishes to container port7860while the app actually bindsPORT. 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 aportinput (default"7860") exposed as a job-levelPORT, sodocker compose up, the readiness curl, and the Playwright base URL all agree on the same port; and the composeportsmapping 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 theDockerfilehealthcheck; this closes the CI side.Note: a job-level
env:is needed rather than a per-step one, becausedocker compose up -dreadsPORTfrom the environment too. And caller-sideenv:doesn't cross theworkflow_callboundary, which is why the port arrives as a declared input.How to test
PORTunset, rundocker compose -f docker-compose.production.yml up -dand check thatcurl localhost:7860/statusreturns 200.PORT=9000 docker compose -f docker-compose.production.yml up -dand check thatcurl localhost:9000/statusreturns 200 (this failed before the fix, since the old mapping pointed at container port 7860).check-dockerworkflow 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 Containerpassed in 2m48s). Step 2 still needs a local run to confirm the override case.