Fix cloudflared health check using host port instead of container port - #44
Merged
Conversation
APP_PORT is the host-side forward port (compose.yaml maps
"${APP_PORT:-80}:80"), but the container-to-container health check
was using it against the internal Docker network, where the app
always listens on 80. Any dev who changed APP_PORT to avoid a host
port clash would see the tunnel fail to start with a false "app not
ready" error after 2 minutes of retries.
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.
Summary
docker/cloudflared/entrypoint.shwas health-checkinghttp://application:${APP_PORT}inside the Docker network, butAPP_PORTis the host-side forward port (compose.yamlmaps"${APP_PORT:-80}:80") — the container always listens internally on80, exactly asdocker/cloudflared/config.ymlalready hardcodes for the tunnel origin..envhappens to defaultAPP_PORT=80. Any dev who changesAPP_PORTto avoid a host port clash would see the tunnel container falsely report "application did not become ready" after exhausting all 60 retries (~2 minutes).80, matchingconfig.yml, and drop the now-unused.env/APP_PORTsourcing.Flagged in review of #42 as out-of-scope for that PR; split into its own branch off
mainper request.Test plan
bash -n docker/cloudflared/entrypoint.sh— syntax checkdocker compose restart cloudflared— confirmed logs showWaiting for application to be ready on http://application:80...→App is ready!→ tunnel registers connections successfully🤖 Generated with Claude Code