fix: reduce Node.js heap size to 4GB in Docker builds to prevent OOM by vjgit96 · Pull Request #11872 · langflow-ai/langflow (original) (raw)
The Vite frontend build was configured with --max-old-space-size=12288 (12GB), which exceeds available RAM on ARM64 CI runners, causing the build process to be OOM-killed during the transform phase.
Reduced to 4GB (4096MB) which is sufficient for the Vite build and prevents OOM kills in memory-constrained Docker BuildKit environments.
[](/apps/coderabbitai)
The recursive chown -R on /app was re-owning the entire .venv (~2.6GB, 40k+ files) which was already correctly owned via COPY --chown=1000:0. This was causing the build to be killed on ARM64 runners.
Changed to non-recursive chown on /app since only the directory itself needs ownership set. /app/data still gets recursive chown (it's empty).
The 40GB ARM64 runner runs out of disk when building 3 Docker images sequentially. Each image (main ~8GB layers, backend ~5GB, frontend) accumulates build cache and layers that exhaust the disk.
Added cleanup steps between builds that:
- Remove the tested image (no longer needed)
- Prune all unused Docker data and buildx cache
- Log disk usage before/after for debugging
Adam-Aghili pushed a commit that referenced this pull request
- fix: reduce Node.js heap size to 4GB in Docker builds to prevent OOM
The Vite frontend build was configured with --max-old-space-size=12288 (12GB), which exceeds available RAM on ARM64 CI runners, causing the build process to be OOM-killed during the transform phase.
Reduced to 4GB (4096MB) which is sufficient for the Vite build and prevents OOM kills in memory-constrained Docker BuildKit environments.
- fix: avoid redundant recursive chown on /app in backend Dockerfile
The recursive chown -R on /app was re-owning the entire .venv (~2.6GB, 40k+ files) which was already correctly owned via COPY --chown=1000:0. This was causing the build to be killed on ARM64 runners.
Changed to non-recursive chown on /app since only the directory itself needs ownership set. /app/data still gets recursive chown (it's empty).
- fix: add Docker cleanup between image builds to prevent disk full
The 40GB ARM64 runner runs out of disk when building 3 Docker images sequentially. Each image (main ~8GB layers, backend ~5GB, frontend) accumulates build cache and layers that exhaust the disk.
Added cleanup steps between builds that:
- Remove the tested image (no longer needed)
- Prune all unused Docker data and buildx cache
- Log disk usage before/after for debugging
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
[ Show hidden characters]({{ revealButtonHref }})