Skip to content

fix(docker): avoid redundant builds and compress preview assets - #56

Open
1052326311 wants to merge 2 commits into
doable-me:mainfrom
1052326311:fix/docker-production-efficiency
Open

1052326311 wants to merge 2 commits into
doable-me:mainfrom
1052326311:fix/docker-production-efficiency

Conversation

@1052326311

@1052326311 1052326311 commented Sep 30, 2026 •

Copy link
Copy Markdown

Problem and changes

Production source updates repeat work that is unnecessary for the requested service. This patch:

  • Separates the Next.js build into web-build, so API/WS/migration images consume the shared package build without compiling the frontend.
  • Uses the already configured distro Chromium executable instead of downloading a second browser; browser validation now fails the image build if the executable is broken.
  • Persists npm downloads in a named volume across API container replacements.
  • Compresses preview, Next static, and published-site responses for selected MIME types. API SSE paths and text/event-stream are excluded.
  • Adds an opt-in WEB_BUILD_MEMORY_MB build argument for Node/Turbopack compilation budgets. The upstream default remains unchanged.

Validation

The Chromium/cache/compression changes have been exercised in a Docker Production deployment. A representative preview module transferred 206,571 gzip bytes instead of 1,113,787 raw bytes, with identical decompressed contents; this is an asset-size result, not an overall latency claim. Health and WebSocket checks remained healthy after the gateway update.

The separated API production build completed successfully without running the Next.js build, and its Chromium executable check passed. A downstream web build using a 512 MiB compilation budget completed successfully; the upstream opt-in argument wiring has not been rebuilt across platforms. The budget is an example, not a recommended universal memory limit.

No instance domains, provider credentials, branding, or host-specific swap/resource-management scripts are included.

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