Files
Edu/infra/apollo-router/Dockerfile
SpecialX 163bff6666 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
2026-07-15 01:32:14 +08:00

30 lines
852 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Apollo Router Dockerfile (v2.1 M2)
#
# 自包含镜像rover组合 supergraph+ apollo-router运行时
# 启动时自动等待子图就绪 → rover compose → 启动 router
FROM ghcr.io/apollographql/router:v1.45.0
USER root
# 安装 curlhealthcheck + rover 下载)
RUN apt-get update && \
apt-get install -y --no-install-recommends curl ca-certificates && \
rm -rf /var/lib/apt/lists/*
# 安装 roverApollo CLI for supergraph composition
RUN curl -sSL https://rover.apollo.dev/nix/v0.30.0 | sh -s -- --install /usr/local/bin
# 接受 ELv2 许可
ENV APOLLO_ELV2_LICENSE=accept
# 复制配置文件
COPY router.yaml /dist/configuration.yaml
COPY supergraph.yaml /dist/supergraph.yaml
COPY entrypoint.sh /dist/entrypoint.sh
RUN chmod +x /dist/entrypoint.sh
EXPOSE 3000 8088
ENTRYPOINT ["/dist/entrypoint.sh"]