Repository navigation
feat: make container listen port configurable - #114
Open
utpalsinghdev wants to merge 1 commit into
Open
utpalsinghdev wants to merge 1 commit into
utpalsinghdev wants to merge 1 commit into
Conversation
A different published host port already works without a rebuild. Host networking and required container ports still need nginx to listen on something other than 8080. OPENCONCHO_PORT defaults to 8080. Invalid values fail before nginx starts. IPv4 and IPv6 listen directives stay in sync.
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
nginx currently listens on 8080 for IPv4 and IPv6. On a normal bridge network you can already publish a different host port without rebuilding (
-p 9090:8080). Host networking and environments that require a specific container port still need the process itself to listen elsewhere.This adds
OPENCONCHO_PORT(default 8080). Unset or empty keeps 8080. Values must be decimal 1-65535 with no leading zeros; anything else fails before nginx starts. Both listen directives are rendered from that value with a narrow placeholder replace, not unrestricted envsubst, so nginx variables like$upstreamstay intact.The image still runs as UID 101, so ports below 1024 may fail to bind.
EXPOSE 8080is metadata only. Compose keeps the loopback bind and maps127.0.0.1:8080:${OPENCONCHO_PORT:-8080}. Helmservice.containerPortis unchanged; if you set the env in a chart deploy, update the container port and probes to match.This overlaps config staging in #96 (still open) but does not replace that PR. Listen rendering runs on the staged
/etc/nginx/conf.d/default.confafter the existing entrypoint copy.Type
Test plan
make smoke-docker(default 8080, custom 9090 on the same image, empty env, invalid values, read-only + uid 101 tmpfs, existing /api proxy and allowlist checks)make check(lint, typecheck, 160 vitest)make ci-web(matches PR CI)@openconcho/webbuild succeedsmake builddesktop: missing GTK on this machine. No desktop paths in this diff.Related issues
Closes #111