diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4e97bd4739..1a8409df0f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -37,6 +37,7 @@ variables: POSTGRES_PASSWORD: 'password' POSTGRES_HOST_AUTH_METHOD: 'trust' DEBIAN_FRONTEND: 'noninteractive' + NODE_OPTIONS: '--max_old_space_size=3072' CARGO_PROFILE_DEV_OPT_LEVEL: '0' CARGO_PROFILE_DEV_LTO: 'off' CARGO_PROFILE_DEV_DEBUG: 'none' diff --git a/Dockerfile b/Dockerfile index 15c8e5a159..eea100f4ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,7 @@ COPY packages/backend-rs packages/backend-rs/ # Compile backend-rs RUN ln -s $(which gcc) /usr/bin/aarch64-linux-musl-gcc -RUN NODE_ENV='production' pnpm run --filter backend-rs build +RUN NODE_ENV='production' NODE_OPTIONS='--max_old_space_size=3072' pnpm run --filter backend-rs build # Copy/Overwrite index.js to mitigate the bug in napi-rs codegen COPY packages/backend-rs/index.js packages/backend-rs/built/index.js @@ -46,7 +46,7 @@ RUN pnpm install --frozen-lockfile COPY . ./ # Build other workspaces -RUN NODE_ENV='production' pnpm run --recursive --filter '!backend-rs' build && pnpm run build:assets +RUN NODE_ENV='production' NODE_OPTIONS='--max_old_space_size=3072' pnpm run --recursive --filter '!backend-rs' build && pnpm run build:assets # Trim down the dependencies to only those for production RUN find . -path '*/node_modules/*' -delete && pnpm install --prod --frozen-lockfile