heartwood every commit a ring

Disable parallel minification to fix OOM in Docker build

2928cab0 by Isaac Bythewood · 2 months ago

Disable parallel minification to fix OOM in Docker build

TerserPlugin and CssMinimizerPlugin spawn parallel worker threads by
default, causing the build to exceed available memory on the server.
Setting parallel: false runs minification single-threaded, trading
build speed for a drastically lower peak memory footprint. Also reverts
the NODE_OPTIONS heap increase which was making the problem worse by
encouraging the allocator to consume memory the host doesn't have.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
modified Dockerfile
@@ -45,7 +45,7 @@ COPY . .ENV PATH="/app/.venv/bin:/app/node_modules/.bin:$PATH" \    PYTHONPATH="/app/.venv/lib/python3.12/site-packages:$PYTHONPATH"RUN NODE_OPTIONS="--max-old-space-size=2048" webpack --config webpack.config.js --mode production && \RUN webpack --config webpack.config.js --mode production && \    python manage.py collectstatic --noinputRUN chown -R ubuntu:ubuntu /app && \
modified webpack.config.js
@@ -20,8 +20,8 @@ module.exports = {  optimization: {    minimize: true,    minimizer: [      new CssMinimizerPlugin(),      new TerserPlugin(),      new CssMinimizerPlugin({ parallel: false }),      new TerserPlugin({ parallel: false }),    ],  },  plugins: [