feat(infra): apollo router deployment and supergraph composition

M2: Apollo Router replaces BFF manual aggregation (ADR-037)

- Dockerfile: self-contained with rover + router, auto-compose on startup

- router.yaml: CORS, Router-Authorization header injection, traffic shaping

- supergraph.yaml: 6 subgraphs (iam/core-edu/content/msg/ai/data-ana)

- docker-compose: apollo-router on port 3000, depends on all subgraphs

- ROUTER_AUTH_SECRET added to secrets.example.env

- port-allocation.md: apollo-router registered on port 3000
This commit is contained in:
SpecialX
2026-07-15 01:32:14 +08:00
parent 6af1aa0d82
commit 163bff6666
7 changed files with 266 additions and 13 deletions

View File

@@ -37,20 +37,21 @@
## 3. NestJS BFF + 业务服务3000-3099
| 服务 | HTTP 端口 | gRPC 端口 | 说明 | 阶段 |
| ----------- | --------- | --------- | ----------------------------------------------- | ------- |
| iam | 3002 | 50052 | P2 启用 gRPC serverI1 裁决2026-07-09 修正) | P2 ✅ |
| teacher-bff | 3003 | — | BFF 不暴露 gRPC对下游走 gRPC | P2 ✅ |
| core-edu | 3004 | 50053 | 含原 classes 服务(合并后) | P3 |
| content | 3005 | 50054 | Neo4j + ES | P4 |
| data-ana | 3006 | 50055 | HTTP 保留作 Gateway 直连降级gRPC 为 P4 主入口 | P4 |
| msg | 3007 | 50056 | 通知中心 | P5 |
| ai | 3008 | 50058 | LLM 网关 | P5 |
| student-bff | 3009 | — | BFF 不暴露 gRPC | P3 |
| parent-bff | 3010 | — | BFF 不暴露 gRPC | P4 |
| ~~classes~~ | ~~3001~~ | ~~—~~ | 已合并入 core-eduP3 | P1 历史 |
| 服务 | HTTP 端口 | gRPC 端口 | 说明 | 阶段 |
| ------------- | --------- | --------- | ----------------------------------------------- | ------- |
| apollo-router | 3000 | | v2.1 GraphQL 聚合层(替代 BFF 手动聚合) | P3 |
| iam | 3002 | 50052 | P2 启用 gRPC serverI1 裁决2026-07-09 修正) | P2 ✅ |
| teacher-bff | 3003 | — | BFF 不暴露 gRPC对下游走 gRPC | P2 ✅ |
| core-edu | 3004 | 50053 | 含原 classes 服务(合并后) | P3 |
| content | 3005 | 50054 | Neo4j + ES | P4 |
| data-ana | 3006 | 50055 | HTTP 保留作 Gateway 直连降级gRPC 为 P4 主入口 | P4 |
| msg | 3007 | 50056 | 通知中心 | P5 |
| ai | 3008 | 50058 | LLM 网关 | P5 |
| student-bff | 3009 | — | BFF 不暴露 gRPC | P3 |
| parent-bff | 3010 | — | BFF 不暴露 gRPC | P4 |
| ~~classes~~ | ~~3001~~ | ~~—~~ | 已合并入 core-eduP3 | P1 历史 |
> **端口空闲**3000、3011-3099 预留扩展。
> **端口空闲**3011-3099 预留扩展。
---