From bc0a2a408fdffe985c5905a08d9a5682f71f97b9 Mon Sep 17 00:00:00 2001 From: LemonNeko Date: Sat, 30 Mar 2024 18:21:01 +0800 Subject: [PATCH] faster image building --- Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2863afd..5d6da3e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,13 +7,17 @@ RUN GO111MODULE=on RUN mkdir /app -COPY . /app/insights-bot - WORKDIR /app/insights-bot +COPY go.mod /app/insights-bot/go.mod +COPY go.sum /app/insights-bot/go.sum + RUN go env RUN go env -w CGO_ENABLED=0 RUN go mod download + +COPY . /app/insights-bot + RUN go build -a -o "release/insights-bot" "github.com/nekomeowww/insights-bot/cmd/insights-bot" # --- runner ---