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"]