ServiceAPI Gateway
Runtime API Gateway
Runtime, container, health và local compose wiring của Go API Gateway.
Runtime API Gateway
Container
| Item | Giá trị |
|---|---|
| Repo/folder | api-gateway |
| Container | centeros-api-gateway |
| Image | dorrissdang/centeros-api-gateway:main |
| Host/container port | 8080:8080 |
| App name | centeros-api-gateway |
Trong centeros-ops/compose.yaml, image được build từ:
${CENTEROS_DOCKERHUB_ORG:-dorrissdang}/centeros-api-gateway:${GATEWAY_IMAGE_TAG:-${CENTEROS_IMAGE_TAG:-main}}Không copy secret hoặc giá trị private từ .env vào docs.
Health
| Endpoint | Trạng thái |
|---|---|
GET /healthz | Đã đóng |
Code cũng có readiness/actuator handlers, nhưng checkpoint hiện tại chỉ đóng GET /healthz.
Local compose
Gateway chạy trong profile app và depends on centeros-identity-service.
Docker network target tới Identity Service:
http://centeros-identity-service:8081Identity JWKS trong compose:
http://centeros-identity-service:8081/.well-known/jwks.jsonGateway không kết nối PostgreSQL trực tiếp trong compose. DB-backed services dùng Postgres service nội bộ; host Postgres trong compose expose ra 5433:5432.
Env vars
Các env var runtime chính, chỉ ghi tên:
| Env var | Dùng cho |
|---|---|
APP_NAME | app name |
APP_ENV | environment |
HTTP_HOST | bind host |
HTTP_PORT | bind port |
LOG_LEVEL | log level |
LOG_FORMAT | log format |
CENTEROS_IDENTITY_SERVICE_URL | target Identity Service |
CENTEROS_ENTITLEMENT_SERVICE_URL | target Entitlement Service |
CENTEROS_PAYMENT_SERVICE_URL | target Payment Service |
CENTEROS_JWT_JWKS_URL | Identity JWKS URL |
CENTEROS_JWT_EXPECTED_ISSUER | expected issuer |
CENTEROS_JWT_EXPECTED_ALGORITHM | expected JWT alg |
CENTEROS_CORS_ALLOWED_ORIGINS | CORS origins |
TODO
- Chưa đóng: document retry/circuit breaker behavior sau khi validation có bằng chứng.
- Chưa đóng: runtime status cho downstream services ngoài Identity Service.