feat(scaffold): add Dockerfile [skip ci]

This commit is contained in:
2026-05-11 10:29:16 +00:00
parent f83304d7c1
commit 14899aae47

20
Dockerfile Normal file
View File

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