From 9df96375c3b7f8307403fbf98991eb8e5b5413dc Mon Sep 17 00:00:00 2001 From: zhouyonggao <1971162852@qq.com> Date: Fri, 28 Nov 2025 14:49:52 +0800 Subject: [PATCH] =?UTF-8?q?ci(docker):=20=E4=BC=98=E5=8C=96Dockerfile?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=9B=BD=E5=86=85=E9=95=9C=E5=83=8F=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 配置GOPROXY使用国内代理并替换Alpine镜像源为阿里云镜像,以加速构建过程 --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 314e816..eebf41e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ FROM golang:1.21-alpine AS build +ENV GOPROXY=https://goproxy.cn,direct +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories WORKDIR /app RUN apk add --no-cache build-base COPY server/ ./server/ @@ -7,6 +9,7 @@ WORKDIR /app/server RUN go build -o /app/bin/marketing-data-server ./cmd/server FROM alpine:3.19 +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories WORKDIR /app COPY --from=build /app/bin/marketing-data-server /app/bin/marketing-data-server COPY --from=build /app/web /app/web