From ea0f5d8765a4c73e45498e1ad28941b61e3e5825 Mon Sep 17 00:00:00 2001 From: liuyuanchuang Date: Thu, 11 Dec 2025 11:22:56 +0800 Subject: [PATCH] refact: update dockerfile --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7ae85d6..ec077d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,13 @@ WORKDIR /app # Copy source code COPY . . +ENV GOPROXY=https://goproxy.cn,direct +ENV GOSUMDB=off + + # Build binary -RUN CGO_ENABLED=0 GOOS=linux go build -mod=vendor -o doc_ai ./main.go +RUN go mod download && \ + CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o doc_ai ./main.go # Runtime stage FROM alpine:latest