Phase 2 service decomposition per docs/SCALE-EXPANSION.md section 1: extracts
internal/{airwallex,bridge,card,tenant,httpserver} out of the monolithic
gateway into four independently deployable gRPC services (each own go.mod,
Dockerfile, and tests), with gateway now a thin BFF that fans out through new
cardissuanceclient/webhookeventsclient gRPC clients. gateway.proto's external
surface is unchanged — agent/tui/cli still talk to gateway exactly as before.
Verified: all 10 go.work modules build and `go test ./...` passes across
every one, including the new gateway client packages against the live split
services (via `make build && make test`).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
32 lines
955 B
Docker
32 lines
955 B
Docker
# Build context MUST be the repo root (services/tenant-registry's
|
|
# go.mod has `replace github.com/caelum0x/ration/pkg => ../../pkg`, a
|
|
# relative path into the monorepo) — build with:
|
|
# docker build -f services/tenant-registry/Dockerfile -t ration/tenant-registry .
|
|
|
|
FROM golang:1.26-alpine AS build
|
|
|
|
ENV GOWORK=off \
|
|
CGO_ENABLED=0 \
|
|
GOOS=linux
|
|
|
|
WORKDIR /src
|
|
|
|
COPY pkg/go.mod pkg/go.sum ./pkg/
|
|
COPY services/tenant-registry/go.mod services/tenant-registry/go.sum ./services/tenant-registry/
|
|
WORKDIR /src/services/tenant-registry
|
|
RUN go mod download
|
|
|
|
WORKDIR /src
|
|
COPY pkg/ ./pkg/
|
|
COPY services/tenant-registry/ ./services/tenant-registry/
|
|
|
|
WORKDIR /src/services/tenant-registry
|
|
RUN go build -trimpath -ldflags="-s -w" -o /out/tenant-registry ./cmd/tenant-registry
|
|
|
|
FROM gcr.io/distroless/static-debian12:nonroot
|
|
|
|
COPY --from=build /out/tenant-registry /usr/local/bin/tenant-registry
|
|
|
|
EXPOSE 7011
|
|
ENTRYPOINT ["/usr/local/bin/tenant-registry"]
|