ci, container: specify NODE_OPTIONS

This commit is contained in:
naskya 2024-07-02 23:15:18 +09:00
parent acc371a804
commit 4ec930ff6a
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
2 changed files with 3 additions and 2 deletions

View file

@ -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'

View file

@ -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