From 37ea337aadc6711d9d7c0fc2c895284ace27146f Mon Sep 17 00:00:00 2001 From: Khinshan Khan Date: Tue, 1 Apr 2025 23:23:30 -0400 Subject: [PATCH] fancy multi stage builder pattern --- Dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3fd649d..542b47f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,15 @@ FROM golang:alpine AS builder RUN apk --update add ca-certificates git make bash + WORKDIR /app COPY . ./ + RUN go mod tidy RUN make bot -ENTRYPOINT ["bin/bot"] + +FROM alpine +RUN apk --no-cache add ca-certificates + +COPY --from=builder /app/bin/bot /bot + +ENTRYPOINT ["/bot"]