bldg14 / eventual

A simple event calendar
https://eventual-client.fly.dev
MIT License
0 stars 0 forks source link

Updates to Dockerfile #41

Closed kevinfalting closed 11 months ago

kevinfalting commented 11 months ago

Issue Description

I'd like to use gcr.io/distroless/static for the go image instead of building from scratch, it already includes much of what is required to run a go binary and has strong support from the community.

Supporting Documentation

No response

Implementation Details

This is what I plan to commit.

ARG GO_VERSION=1.21.0

FROM golang:${GO_VERSION} AS builder

WORKDIR /app
COPY go.mod go.sum /app/
RUN go mod download

COPY ./cmd/eventual /app/cmd/eventual
COPY ./internal /app/internal
RUN CGO_ENABLED=0 go build --trimpath -o /bin/eventual ./cmd/eventual

FROM gcr.io/distroless/static AS production

COPY --from=builder /bin/eventual /

EXPOSE 8080
USER nonroot
ENTRYPOINT ["/eventual"]

Acceptance Criteria