fix(docker): raise builder Node heap limit and make tsc typecheck opt-in during image build

This commit is contained in:
tyuXX 2026-11-28 15:52:22 +00:00
parent 2cbcde6d46
commit 65d88f0a1e
2 changed files with 9 additions and 1 deletions

View file

@ -12,7 +12,10 @@ RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi
COPY tsconfig.json ./
COPY src ./src
RUN npm run build && npm prune --omit=dev
ARG RUN_TYPECHECK=false
ARG BUILD_NODE_MAX_OLD_SPACE=768
ENV NODE_OPTIONS="--max-old-space-size=${BUILD_NODE_MAX_OLD_SPACE}"
RUN if [ "$RUN_TYPECHECK" = "true" ]; then npm run build; else npm run build:client && npm run build:server; fi && npm prune --omit=dev
FROM node:22-bookworm-slim AS runtime
WORKDIR /app