godoor/Dockerfile

18 lines
339 B
Docker
Raw Permalink Normal View History

2023-08-10 15:42:41 +00:00
FROM golang:1.21 as build
WORKDIR /godoor
# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
COPY go.mod go.sum ./
RUN go mod download && go mod verify
COPY . .
RUN make build
FROM scratch
WORKDIR /
COPY --from=build /godoor/godoor /godoor
ENTRYPOINT ["/godoor"]