dev-pod-api-build/Dockerfile
2026-04-16 04:16:36 +00:00

25 lines
428 B
Docker

# Build stage
FROM golang:1.25-alpine AS builder
RUN apk add --no-cache git
WORKDIR /build
# Cache dependencies
COPY go.mod go.sum ./
RUN go mod download
# Build binary
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /dev-pod-api .
# Final stage
FROM gcr.io/distroless/static-debian12:nonroot
COPY --from=builder /dev-pod-api /dev-pod-api
EXPOSE 8080
USER nonroot:nonroot
ENTRYPOINT ["/dev-pod-api"]