chore: 改为本地构建,传dist文件到服务端
Some checks failed
Web UI CI/CD / build-and-deploy (push) Has been cancelled
Some checks failed
Web UI CI/CD / build-and-deploy (push) Has been cancelled
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -38,11 +38,15 @@ RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store \
|
||||
pnpm install --frozen-lockfile --network-concurrency 2
|
||||
|
||||
# 限制turbo并发构建,降低资源占用(仅CI/CD构建时生效)
|
||||
# 并发数设为2,平衡构建速度和资源占用
|
||||
# 并发数设为1,Vite构建阶段非常消耗资源,串行构建更稳定
|
||||
# 降低Node.js内存限制,避免占用过多内存影响其他服务(服务器8GB内存)
|
||||
# 每个Node进程限制为2GB,2个并发进程共4GB,为系统和其他服务预留4GB
|
||||
ENV NODE_OPTIONS=--max-old-space-size=2048
|
||||
RUN pnpm exec turbo build --filter=@vben/web-antd --concurrency=2
|
||||
# 限制为1024MB,为系统和其他服务预留更多内存(约7GB)
|
||||
# 限制Node.js线程池大小,减少并发线程数,降低CPU占用
|
||||
ENV NODE_OPTIONS=--max-old-space-size=1024
|
||||
ENV UV_THREADPOOL_SIZE=2
|
||||
# 设置垃圾回收更频繁,减少内存峰值
|
||||
ENV NODE_OPTIONS="$NODE_OPTIONS --expose-gc"
|
||||
RUN pnpm exec turbo build --filter=@vben/web-antd --concurrency=1
|
||||
|
||||
# ==============================
|
||||
# 2️⃣ 运行阶段
|
||||
|
||||
Reference in New Issue
Block a user