Skip to content

feat: make container listen port configurable - #114

Open
utpalsinghdev wants to merge 1 commit into
offendingcommit:mainfrom
utpalsinghdev:utpalsinghdev/configurable-port
Open

utpalsinghdev wants to merge 1 commit into
offendingcommit:mainfrom
utpalsinghdev:utpalsinghdev/configurable-port

Conversation

@utpalsinghdev

@utpalsinghdev utpalsinghdev commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

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 $upstream stay intact.

The image still runs as UID 101, so ports below 1024 may fail to bind. EXPOSE 8080 is metadata only. Compose keeps the loopback bind and maps 127.0.0.1:8080:${OPENCONCHO_PORT:-8080}. Helm service.containerPort is 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.conf after the existing entrypoint copy.

Type

  • New feature

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/web build succeeds
  • Full make build desktop: missing GTK on this machine. No desktop paths in this diff.

Related issues

Closes #111

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.
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.

Make port configurable.

1 participant