Files
template-go-backend/Dockerfile
2025-11-19 01:39:18 +03:00

14 lines
272 B
Docker

FROM golang:1.24.9-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o service ./src
FROM gcr.io/distroless/static
WORKDIR /
COPY --from=builder /app/service .
ENTRYPOINT [ "/service"]