build: serve frontend and marketing via unprivileged nginx on 8080 - #1198
Draft
ital0 wants to merge 3 commits into
Draft
build: serve frontend and marketing via unprivileged nginx on 8080#1198ital0 wants to merge 3 commits into
ital0 wants to merge 3 commits into
Conversation
- run nginx as non-root uid 101 and move container, service target, and target-group traffic from port 80 to 8080 - keep public ALB listeners on port 80 - note that the target-group port change replaces target groups on the next Pulumi update
- satisfy container hardening and code-scanning checks with an explicit runtime user - retain port 8080 target-group and container mappings for non-root nginx
- keep deployment guidance aligned with the hardened container base - document the frontend container's port 8080 target
Semgrep Security ScanNo security issues found. |
|
Preview environment deployed 🚀
Stack: Auto-destroys on PR close/merge. Login via the bundled Keycloak realm — |
PR Metrics
Updated Wed, 05 Aug 2026 20:49:33 GMT · run #2608 |
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.
Fixes code-scanning alert #11 (
dockerfile.security.missing-useronfrontend.Dockerfile).marketing.Dockerfilehas the identical pattern and is fixed alongside for consistency.Changes
Both nginx images now use
nginxinc/nginx-unprivileged:alpine(runs asnginx, uid 101) instead ofnginx:alpine(root). It's built from the same official entrypoint scripts, so the/etc/nginx/templates/*.templateenvsubst machinery the frontend relies on keeps working. Non-root can't bind port 80, so nginx moves to 8080, updated across every layer:deploy/config/nginx.conf.template+deploy/config/marketing-nginx.conf—listen 8080containerPort/portMappingsinalb.ts,per-pr-stack.ts,services.ts. The public ALB HTTP listener and ALB security group stay on 80/443.servicesSgalready allows TCP 0–65535 from the ALB SG, so no SG change was needed.containerPort, readiness-probe port and explicit ServicetargetPort: 8080infrontend.yaml/marketing.yaml(external Service ports unchanged).deploy/docker-compose.yml— host mapping now targets8080(external port unchanged,${FRONTEND_PORT:-3000}).deploy/README.md,deploy/docker/README.md,docs/self-hosting/docker-compose.md).Deploy note
Changing a TargetGroup's port forces replacement;
namePrefixgives create-before-destroy, but existing stacks will briefly re-register targets on their nextpulumi up. Per-PR preview stacks are ephemeral, so impact there is minimal. This PR's own preview deploy exercises the new port wiring end to end.Validation
curlreturns 200 and the nginx process runs asuid=101(nginx)in both.bunx tsc --noEmitpasses indeploy/pulumi.