From 02c26c7a81a3e3f5dfea015bec990fe6f0fd5e30 Mon Sep 17 00:00:00 2001 From: demo-bot Date: Thu, 7 May 2026 08:31:11 +0000 Subject: [PATCH] feat(scaffold): add Dockerfile [skip ci] --- Dockerfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..30513c1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# ---- Build stage ---- +FROM golang:1.22-alpine AS build +WORKDIR /src + +COPY go.mod go.sum* ./ +RUN go mod tidy && go mod download + +COPY . . +RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /app . + +# ---- Runtime stage (distroless) ---- +FROM gcr.io/distroless/static-debian12:nonroot +COPY --from=build /app /app + +EXPOSE 8080 + +HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ + CMD ["/app", "-health-check"] + +ENTRYPOINT ["/app"]