From ff065c7119c8749165de26df0d085dff3fb07b14 Mon Sep 17 00:00:00 2001 From: Adora Laura Kalb Date: Tue, 29 Oct 2024 11:20:22 +0100 Subject: [PATCH] add dockerfile --- Dockerfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..62323fa --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM golang:1.23-bullseye AS dev + +COPY . /var/app +WORKDIR /var/app + + +ENV GO111MODULE="on" \ + CGO_ENABLED=0 \ + GOOS=linux + +EXPOSE 80 +ENTRYPOINT ["sh"] + + +FROM dev AS build + +RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes ca-certificates make git +RUN go mod download && go mod verify +RUN make build + + +FROM gcr.io/distroless/static-debian12 AS prod + +WORKDIR /app +COPY --from=build /var/app/bin/humble-bot /bin/ + +LABEL maintainer="Adora Laura Kalb " + +EXPOSE 8080 +ENTRYPOINT ["/bin/humble-bot"]