Repository navigation
fix: map web containers to port 8080 - #326
Merged
Merged
Conversation
The seamless-templates web and Next.js images now run as non-root and listen on 8080 (seamless-templates#133). Point the generated compose file and the verify harness at 8080, and move the verify reference apps to unprivileged nginx to match.
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.
Companion to fells-code/seamless-templates#142 (fells-code/seamless-templates#133), which moves the web and Next.js production images to non-root and port 8080.
Draft on purpose: this cannot pass conformance until seamless-templates#142 is on templates
main. Merge order is below.What changed and why
src/generators/docker/docker.ts:webService()andfullStackWebService()publish127.0.0.1:5173:8080. The nginx web service health-checkshttp://127.0.0.1:8080/health(127.0.0.1 rather thanlocalhost, because busybox wget resolveslocalhostto::1and the template's nginx listens on IPv4 only; this matches the templates' ownHEALTHCHECK). The full-stack service health-checkshttp://localhost:8080/healthwithfetch. The full-stack service runs the Next.jsdevtarget, which seamless-templates#142 moved tonext dev --port 8080.src/generators/docker/docker.test.ts: the port assertions move to 8080, plus new assertions on both healthcheck URLs.verify/docker-compose.verify.yml:react,angular,vue,svelte,nextjsandnextjs-devmap5173:8080and health-check 8080. Thereactservice builds from an inline Dockerfile that copies the template'snginx.conf, so its runtime stage moves tonginxinc/nginx-unprivileged:alpinewith the web root owned bynginx, the same as the template Dockerfiles. The*-devservices for vite, Angular, Vue and Svelte were already on5173:5173and are unchanged.verify/{angular,vue,svelte}-app(the reference apps): moved tonginxinc/nginx-unprivileged:alpineon 8080, because they share theangular/vue/sveltecompose services with the templates. They only run when the templates registry has no template for that framework, which is not the case on templatesmaintoday.Not touched:
.github/workflows, and the templates pin (SEAMLESS_TEMPLATES_REF/SEAMLESS_TEMPLATES_COMMIT), since no templates release carries the change yet. No README or docs text referred to the container port (they only mention host port 5173, which is unchanged).Merge order
How each job picks its templates:
conformance.ymlcallingverify-conformance.yml, here and in every sibling repo) checks out seamless-templates attemplates-ref, which is empty in this repo, so it uses templatesmain, not the pin. seamless-templates' ownconformance.ymlrunsseamless-cli/.github/workflows/verify-conformance.yml@mainwithcli-refempty, so it runs this repo'smainharness against the templates PR head.seamless init) download templates at the pinnedSEAMLESS_TEMPLATES_COMMIT(v0.21.0, still on port 80). No CI job exercises the web container of a scaffold:scaffold-smokeonly brings updbandauth, anddocker.test.tsasserts strings.ci.yml(build, tests,check:templates-pin) does not care about the port.So the two PRs deadlock on conformance, in both orders. Whichever merges first does so red, and until the other one merges every conformance run in the ecosystem (seamless-auth-api, seamless-auth-server, the SDK repos, seamless-templates, this repo, and the daily
released-smoke) fails the production browser layers:react-vite,react-oauth,angular,vue,svelte,nextjsand, with--dev,nextjs (dev). The api, adapter and vite/Angular/Vue/Svelte dev-server layers are unaffected. The cause is a container listening on one port while compose maps and health-checks the other (or, for thereactservice once this lands against templates on 80, unprivileged nginx failing to bind port 80), so the service never becomes healthy and its layer fails.Separately, once this is on
mainand before the pin bump, a scaffold frommainmaps 8080 against a v0.21.0 web image that listens on 80, so the generatedwebservice never gets healthy. Nothing in CI catches that, so the CLI must not be released in that window.Recommended sequence:
mainharness, still on 80).main. Mark it ready and merge it immediately, which ends the ecosystem-wide red window.SEAMLESS_TEMPLATES_REFto v0.22.0 andSEAMLESS_TEMPLATES_COMMITto its commit (git ls-remote https://github.com/fells-code/seamless-templates 'refs/tags/v0.22.0^{}') in a follow-up PR.Templates first, rather than this first, because then the change pair is validated together by this PR's conformance run before the second merge; in the reverse order the red window is the same length but nothing runs both halves together until after both have merged. If a shorter scaffold gap matters more than the conformance window, the alternative is to hold this PR after step 1 until step 3 and push the pin bump onto it, at the cost of a longer red window across the other repos.
Checks
npm run build: exit 0.npm test:Tests 1482 passed | 4 skipped (1486).npm run coverage:All files | 98.88 | 96.24 | 98.36 | 99.22(statements, branches, functions, lines), thresholds met, exit 0.npm run check:templates-pin:SEAMLESS_TEMPLATES_COMMIT matches fells-code/seamless-templates v0.21.0 (abed6be...).npm run check:types-current:@seamless-auth/types "^0.33.0" is current (latest 0.33.0).docker compose -f verify/docker-compose.verify.ymlwith every browser profileconfig --quiet: exit 0.docker build --target runtimeofverify/vue-app, thendocker run -p 127.0.0.1:15173:8080: runs asuid=101(nginx),/health200,/200, and the entrypoint-writtenconfig.jsis served. The Angular and Svelte reference Dockerfiles carry the identical change.