Fix Docker build: canvas native compile and Vite heap OOM on node:20-slim#372
Draft
Copilot wants to merge 2 commits into
Draft
Fix Docker build: canvas native compile and Vite heap OOM on node:20-slim#372Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
- Install build toolchain and Cairo dev libs in frontend-builder stage so the native 'canvas' module compiles during yarn install on node:20-slim. - Add NODE_HEAP_MB build-arg (default 8192) and set NODE_OPTIONS to avoid 'JavaScript heap out of memory' during the Vite build. - Expose NODE_HEAP_MB build arg in docker-compose.yml. - Realign @tiptap/extension-table* yarn.lock keys to ^3.22.2 to match package.json so 'yarn install --frozen-lockfile' succeeds.
Copilot
AI
changed the title
[WIP] Fix Docker build failure due to canvas native compile error
Fix Docker build: canvas native compile and Vite heap OOM on node:20-slim
Jun 28, 2026
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.
docker compose up --buildfailed in thefrontend-builderstage:canvas(node-gyp rebuild) had no native toolchain or Cairo headers onnode:20-slim, and the Vite build hitJavaScript heap out of memoryagainst Node's ~2 GB default heap regardless of Docker memory.Changes
Dockerfile— canvas build deps: installpython3 make g++ pkg-configand Cairo/Pango/JPEG/GIF/RSVG dev libraries beforeyarn installso the native module compiles.Dockerfile— heap limit: addARG NODE_HEAP_MB=8192andENV NODE_OPTIONS=--max-old-space-size=${NODE_HEAP_MB}beforeyarn build, overridable per build.docker-compose.yml: surfaceNODE_HEAP_MB: "8192"underbuild.args.yarn.lock— frozen-lockfile blocker: realign the four@tiptap/extension-table*keys from^3.23.6to^3.22.2to matchpackage.json, keeping the existing3.23.6resolutions. Without this,yarn install --frozen-lockfileaborts before reaching the canvas/build steps.The
yarn.lockrealignment is intentionally limited to key strings (no version bumps, no registry/URL churn) to keep the dependency tree byte-identical aside from the range match.