docs: Node Dockerfile hard rules (NODE_ENV, heap, serialize stages)

This commit is contained in:
gitea-robot
2026-07-31 20:15:15 +08:00
parent 0719e4fa2d
commit 520c121176
2 changed files with 68 additions and 15 deletions

View File

@@ -123,6 +123,10 @@ MCP endpoint`https://company-deploy-mcp.loncode.site/mcp`
- 识别栈;保证 Dockerfile`.gitignore` 排除密钥
- 有状态:默认 `/data`;多目录用 `persistence[]`
- 需要库:`databases: [{ engine: "postgres"|"mysql", ... }]`
- **Node 多阶段硬规则**(详见 `stack-profiles.md`
- 禁止在 `npm ci`/`pnpm install` **之前** `ENV NODE_ENV=production`(否则 `nest`/`vite` not found
- 大前端 Vite`NODE_OPTIONS=--max-old-space-size=3072`
- runtime 用 `COPY --from=build` 串行,避免并行双 `npm ci` 把小机打爆
### 2. 仓库与推送(权限红线)
@@ -299,6 +303,8 @@ Agent **不要**在 MCP 路径下再调 Dokploy `domain.create`(避免双绑/
|------|------|
| 401 / 要 Feishu Key | 引导连接中心登录,配置 `buxi_` |
| git push 权限 / Permission denied / 要配 SSH | **错误路径**。改用 `ensure_repository``agentHint.pushUrl` 推送;禁止给用户配 SSH |
| `nest: not found` / `vite: not found` | build 阶段在装依赖前设了 `NODE_ENV=production`;先全量 `npm ci` 再设 production |
| `JavaScript heap out of memory` | Dockerfile build 加 `NODE_OPTIONS=--max-old-space-size=3072`;避免并行 npm ci机器内存过小则升配 |
| 运行中项目达上限 | `get_my_quota`;停/删旧应用后再部署 |
| Forbidden 看他人项目 | 非管理员;加 `ADMIN_OPEN_IDS` 或只查自己的 |
| 有部署无 HTTPS | 等 LE查 DNS/80控制面证书配置 |