Files
hello-gin/Dockerfile
Kaarel 89914ce2ba
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Add
2026-02-16 11:36:00 +02:00

18 lines
424 B
Docker

FROM golang:1.23-alpine AS build
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY cmd ./cmd/
COPY templates ./templates/
COPY static ./static/
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /app/server ./cmd
FROM scratch
WORKDIR /
COPY --from=build /app/server /server
COPY --from=build /app/templates /templates
COPY --from=build /app/static /static
ENV GIN_MODE=release
EXPOSE 8000 8080
ENTRYPOINT ["/server"]