From 38f29e147f41b06ccfd50c5d0481f5a8907a7dfe Mon Sep 17 00:00:00 2001 From: Bastien Riviere Date: Mon, 29 Jan 2024 21:25:57 +0100 Subject: [PATCH] chore: add Dockerfile --- Dockerfile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..de40a00 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM golang:latest as builder + +WORKDIR /app + +COPY go.mod go.sum ./ +RUN go mod download + +COPY . ./ +RUN CGO_ENABLED=0 go build -o short . + +FROM alpine:latest +RUN apk --no-cache add ca-certificates + +WORKDIR /app +COPY --from=builder /app/short /short + +ENTRYPOINT ["/short"]