Skip to content

feat(frontend): add nginx production container - #705

Open
woahwhattheheck wants to merge 4 commits into
Protocol-Guild:mainfrom
woahwhattheheck:fix/frontend-container-539
Open

woahwhattheheck wants to merge 4 commits into
Protocol-Guild:mainfrom
woahwhattheheck:fix/frontend-container-539

Conversation

@woahwhattheheck

Copy link
Copy Markdown

Closes #539.

What

  • Add a multi-stage frontend container: Node 22 Alpine build stage, nginx Alpine slim runtime.
  • Serve only Vite dist output in the runtime image.
  • Add SPA fallback to index.html while keeping missing hashed assets as real 404s.
  • Send Cache-Control: no-store for the entry point / SPA fallback and one-year immutable caching for Vite fingerprinted /assets/ files.
  • Exclude local env files, dependency/build output, reports, and logs from the Docker build context.
  • Document build-time public configuration and focused container acceptance checks.
  • Add a scoped frontend-container workflow so Docker size/nginx/static-serving behavior stays checked on future frontend changes.

Validation

Exact current head: e69bc297072c0a5dca9f492130263a086e86a51d, based directly on sponsor main@171c74b454daba241bfb75f36d10a0a3a77a68e5.

Fork run 37248045155 completed successfully on that exact head:

  • Docker production build succeeded, including the existing TypeScript + Vite production build.
  • Final image size: 15,289,686 bytes (< 50 MB acceptance limit).
  • nginx -t succeeded.
  • /index.html returned Cache-Control: no-store.
  • /dashboard returned the same SPA entry point with no-store.
  • A real hashed JS asset returned Cache-Control: public, max-age=31536000, immutable.
  • A missing /assets/... path returned 404 and did not receive the immutable cache policy.

The other repository workflows that fail immediately on owner-fork pushes are separate zero-job workflow/configuration gates; they are not represented here as frontend-container source failures.

@woahwhattheheck

Copy link
Copy Markdown
Author

Ready for maintainer review at current head e69bc297072c0a5dca9f492130263a086e86a51d. The issue #539 acceptance checks were exercised on this exact head in fork run 37248045155: production image built at 15,289,686 bytes (<50 MB), nginx -t passed, /index.html and SPA fallback use no-store, a real fingerprinted asset gets one-year immutable caching, and a missing /assets/... path remains a 404. The PR stays within the requested frontend Docker/static-serving scope.

@woahwhattheheck

Copy link
Copy Markdown
Author

/claim #539

Original-author GrantFox OSS/FWC26 contribution and conditional compensation claim: I, @woahwhattheheck (GitHub account ID 293286387), submit this original contribution for issue #539 and affirmatively claim contributor credit and consideration for any eligible bounty compensation under the campaign terms. Please confirm eligibility, acceptance criteria, award amount (if applicable), and payment instructions. No award or payment is presumed.

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.

Add frontend Dockerfile for static site serving

2 participants