From 3f809e933746d150379bf4ee4e984bac21bddcb8 Mon Sep 17 00:00:00 2001 From: Lyric-c Date: Mon, 7 Aug 2023 14:33:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index bc9b798..3a3eb1c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,13 +3,15 @@ FROM golang:1.20.4-alpine3.18 AS builder COPY . /src WORKDIR /src +#国内服务器可以取消以下注释 +#RUN go env -w GO111MODULE=on && \ +# go env -w GOPROXY=https://goproxy.cn,direct + RUN go build -ldflags "-s -w" -o ./bin/ . FROM alpine COPY --from=builder /src/bin /app -COPY --from=builder /src/index.html /app/index.html -COPY --from=builder /src/static /app/static COPY --from=builder /src/config.json /app/config.json WORKDIR /app