Skip to content

fix(docker,release): multi-stage frontend build, asset distribution, and bump to v2.17.1 - #38

Merged
spelech merged 2 commits into
mainfrom
fix/frontend-docker-asset-distribution
Oct 14, 2026
Merged

spelech merged 2 commits into
mainfrom
fix/frontend-docker-asset-distribution

Conversation

@spelech

@spelech spelech commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Summary

Resolves white-screen error (NS_ERROR_CORRUPTED_CONTENT / disallowed MIME type ("application/json")) on https://contextcortex.wileyriley.com caused by missing frontend assets in the published Docker container.

Root Cause

  1. Root .gitignore pattern: .gitignore contained dist/ rather than /dist/, causing git to ignore frontend/dist/assets/ while frontend/dist/index.html was tracked.
  2. Single-Stage Docker Build in CI: Dockerfile did not compile the frontend, relying on COPY . .. In GitHub Actions docker-publish.yml, the build-and-push runner checked out git (which lacked assets/), producing container images that had index.html referencing scripts that did not exist in the container.
  3. Stale Asset Fallback in main.py: When frontend/dist/index.html was detected without frontend/dist/assets, main.py fell back to www/assets (which contained old August 15 bundle hashes). FastAPI returned 404 JSON for missing assets, causing the browser to reject the scripts as modules.

Key Changes

  • Multi-Stage Dockerfile: Built with node:22-alpine frontend build stage running npm ci and npm run build, bundling the resulting distribution into both /app/frontend/dist and /app/www.
  • Build Context Optimization (.dockerignore): Excluded .git, .venv, and node_modules, reducing Docker context transfer from 920MB to 6MB.
  • Fixed .gitignore: Changed dist/ to /dist/ and ignored docs/.vitepress/dist/.
  • Resilient Static Mounting in main.py: Ensures frontend/dist is only selected if both index.html and assets exist together.
  • Favicon Routes: Added /favicon.svg and /favicon.ico endpoints and included them in AuthMiddleware public bypass.
  • Version Bump: Bumped to v2.17.1 across all manifests and documentation.

Visual Verification

ContextCortex v2.17.1 UI

Verification

  • Backend Pytest Suite: 548 passing, 2 skipped
  • Frontend Vitest Suite: 323 passing
  • Release verification engine (scripts/verify_release.py): All 78 markdown links and version consistency checks passed.

@spelech
spelech merged commit 754d4bf into main Oct 14, 2026
15 checks passed
@spelech
spelech deleted the fix/frontend-docker-asset-distribution branch October 14, 2026 03:15
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.

1 participant