fix(build): bound Next page workers in memory-limited builds
This commit is contained in:
parent
eba7ef55e6
commit
e87a6459a8
@ -141,8 +141,10 @@ ENV DINGTALK_CLIENT_ID="build-time-dingtalk-id"
|
||||
ENV DINGTALK_CLIENT_SECRET="build-time-dingtalk-secret"
|
||||
|
||||
# 构建应用(复用 Next.js 构建缓存)
|
||||
# Next 14 默认按宿主 CPU 数量分配预渲染进程,可能超过容器内存限额。
|
||||
# 只在构建期间使用一个页面 worker;不改变运行时的 CPU 或业务并发配置。
|
||||
RUN --mount=type=cache,target=/app/.next/cache \
|
||||
NODE_ENV=production npm run build
|
||||
CIRCLE_NODE_TOTAL=2 NODE_ENV=production npm run build
|
||||
|
||||
# 清理 standalone 目录中不需要的文件(减少 1GB+ 体积)
|
||||
RUN echo "清理 standalone 目录..." && \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user