From 8a18e547fc1ac94e01d5d16ddbe86d32283314ec Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Sun, 12 Apr 2026 18:46:28 +0800 Subject: [PATCH] Add billing service container build --- Dockerfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f8f25dc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM golang:1.25.1-alpine AS builder + +WORKDIR /src + +COPY go.mod go.sum ./ +RUN go mod download + +COPY cmd ./cmd +COPY internal ./internal + +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /out/billing-service ./cmd/billing-service + +FROM alpine:3.22 + +RUN addgroup -S app && adduser -S app -G app + +WORKDIR /app + +COPY --from=builder /out/billing-service /app/billing-service + +USER app + +EXPOSE 8081 + +ENTRYPOINT ["/app/billing-service"]