Skip to content

fix(docker): make Node heap size configurable for frontend build - #1531

Open
fabyo0 wants to merge 1 commit into
HiEventsDev:developfrom
fabyo0:fix/docker-node-heap-size
Open

fabyo0 wants to merge 1 commit into
HiEventsDev:developfrom
fabyo0:fix/docker-node-heap-size

Conversation

@fabyo0

@fabyo0 fabyo0 commented Nov 29, 2026

Copy link
Copy Markdown

Problem

Building the all-in-one image can fail in the frontend stage with:

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
exit code: 134

vite build transforms 16k+ modules and exceeds Node's default heap limit (~2 GB). This happens even on a machine with plenty of RAM (18 GB in my case), because the limit comes from Node itself.

Solution

Add a NODE_MAX_OLD_SPACE_SIZE build arg (default 4096 MB) to Dockerfile.all-in-one and pass it to Node via NODE_OPTIONS before yarn build.

The value can be adjusted at build time:

docker compose build --build-arg NODE_MAX_OLD_SPACE_SIZE=6144

Testing

  • Built with docker compose build and started with docker compose up -d
  • Environment: macOS, Apple Silicon (ARM), 18 GB RAM, Docker Desktop
  • Before: build failed with exit code 134
  • After: build completes successfully

Notes

Docker needs enough total memory for the chosen value (VM RAM must be higher than the Node heap limit).

@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@fabyo0

fabyo0 commented Nov 29, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

This branch has not been deployed

No deployments
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