feat(teacher-portal): Docker Desktop 验证通过 + 切换 standalone 模式 + nextstep.md

- Dockerfile 切换为 Next.js output:standalone 模式
  - 解决 pnpm symlink 在 runtime 下无法解析 react/jsx-runtime 的问题
  - 修复 tsconfig.base.json 未 COPY 到 builder 阶段的问题
- next.config.js 添加 output:"standalone" 配置
- Docker Desktop 验证通过:
  - 镜像构建成功 (1.32GB)
  - 容器启动 Ready in 69ms
  - /api/health 健康检查返回 200
  - 27 静态路由 + 11 动态路由全部 HTTP 200
- 新增 nextstep.md:
  - 下游依赖清单(teacher-bff 61 GraphQL operations + iam + push-gateway)
  - 本模块待补工作(单元测试/设计令牌硬化/i18n/ui-components 扩展/性能/A11y)
  - Docker 部署注意事项 + 路由清单 + 已知问题
- workline.md §5.6 记录 Docker 验证结果
This commit is contained in:
SpecialX
2026-07-13 16:52:13 +08:00
parent 40f07b7a16
commit 8b729a710f
4 changed files with 323 additions and 10 deletions

View File

@@ -311,6 +311,35 @@ gantt
8. 全局搜索(参考项目有 /search API
9. 全局消息中心增强(参考项目有 /messages 页面)
### §5.6 Docker Desktop 验证2026-07-13
**构建**
- Dockerfile 切换为 Next.js `output: "standalone"` 模式(解决 pnpm symlink 在 runtime 下无法解析 react/jsx-runtime 的问题)
- 修复 `tsconfig.base.json` 未 COPY 到 builder 阶段的问题
- 基础镜像:`node:20-alpine`(本地测试可 retag `node:22-alpine`
- 镜像大小1.32GB
**容器运行**
- 启动时间Ready in 69ms
- 健康检查:`/api/health``{"status":"ok","service":"teacher-portal"}`
- 首页HTTP 200length=5921登录页正常渲染
**路由验证**
| 类型 | 通过/总数 | 结果 |
| ---- | --------- | ---- |
| 静态路由 | 27/27 | 全部 HTTP 200 ✅ |
| 动态路由 | 11/11 | 全部 HTTP 200 ✅ |
| GraphQL 端点 | N/A | 服务端代理到 api-gateway未启动时预期 500 |
**已知限制**
- MSW mock 仅浏览器端生效SSR 阶段 GraphQL 请求走 next.config.js rewrites 到 api-gateway
- 生产部署时必须先启动 api-gateway
- 详细下游依赖清单见 `apps/teacher-portal/nextstep.md`
---
## §6 全并行开发说明