My App
ServiceAPI Gateway

Runtime API Gateway

Runtime, container, health và local compose wiring của Go API Gateway.

Runtime API Gateway

Container

ItemGiá trị
Repo/folderapi-gateway
Containercenteros-api-gateway
Imagedorrissdang/centeros-api-gateway:main
Host/container port8080:8080
App namecenteros-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

EndpointTrạ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:8081

Identity JWKS trong compose:

http://centeros-identity-service:8081/.well-known/jwks.json

Gateway 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 varDùng cho
APP_NAMEapp name
APP_ENVenvironment
HTTP_HOSTbind host
HTTP_PORTbind port
LOG_LEVELlog level
LOG_FORMATlog format
CENTEROS_IDENTITY_SERVICE_URLtarget Identity Service
CENTEROS_ENTITLEMENT_SERVICE_URLtarget Entitlement Service
CENTEROS_PAYMENT_SERVICE_URLtarget Payment Service
CENTEROS_JWT_JWKS_URLIdentity JWKS URL
CENTEROS_JWT_EXPECTED_ISSUERexpected issuer
CENTEROS_JWT_EXPECTED_ALGORITHMexpected JWT alg
CENTEROS_CORS_ALLOWED_ORIGINSCORS 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.

On this page