# See services/iam/Dockerfile for the pattern explanation. FROM golang:1.23-bookworm AS build WORKDIR /src COPY go.mod go.sum* ./ COPY gen/ gen/ COPY pkg/ pkg/ COPY services/billing/ services/billing/ RUN go mod tidy RUN CGO_ENABLED=0 go build -o /out/billing-server ./services/billing/cmd/server FROM gcr.io/distroless/static-debian12:nonroot WORKDIR /app COPY --from=build /out/billing-server ./billing-server COPY --from=build /src/services/billing/migrations ./migrations ENV ENKLY_BILLING_GRPC_ADDR=:9002 EXPOSE 9002 ENTRYPOINT ["./billing-server"]