fix: 前端生产构建放宽node堆内存并跳过basicSsl避免服务器卡死

This commit is contained in:
2026-09-02 10:39:05 +08:00
parent 06337fc8eb
commit fe495ad707
2 changed files with 9 additions and 1 deletions

View File

@ -5,6 +5,8 @@
# --- 阶段 1:编译 React ---
FROM node:20-alpine AS builder
WORKDIR /app
# 🚀 构建内存优化:显式放宽 node 堆上限,避免低配服务器 OOM 挂起(卡在 vite build)
ENV NODE_OPTIONS="--max-old-space-size=4096"
COPY package.json package-lock.json ./
RUN npm ci --production=false
COPY . .