From 5b546d14234c256e90f49fa20b3da9336dfd0599 Mon Sep 17 00:00:00 2001 From: izaac49 Date: Thu, 12 Feb 2026 21:18:31 +0700 Subject: [PATCH] Update Dockerfile --- Dockerfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7a6f3aae1..66a64f1c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,15 @@ FROM golang:1.25.7 WORKDIR /app + +# Copy go.mod and go.sum first (better caching) +COPY go.mod go.sum ./ +RUN go mod download + +# Copy the rest of the source code COPY . . -RUN go build -tags netgo -ldflags "-s -w" -o app +# Build the app (assuming main.go is in the root) +RUN go build -tags netgo -ldflags "-s -w" -o app ./... CMD ["./app"]