From 422ef05adc52b2a9c0c350af082ec1760249f624 Mon Sep 17 00:00:00 2001 From: zhx Date: Tue, 12 May 2026 11:26:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 10 ++++++++++ services/activity-service/Dockerfile | 5 +++++ services/cron-service/Dockerfile | 5 +++++ services/gateway-service/Dockerfile | 5 +++++ services/room-service/Dockerfile | 5 +++++ services/user-service/Dockerfile | 5 +++++ services/wallet-service/Dockerfile | 5 +++++ 7 files changed, 40 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index b08cfc0f..e35baf09 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,13 @@ +x-go-build-args: &go-build-args + GOPROXY: "${GOPROXY:-https://goproxy.cn|https://proxy.golang.org|direct}" + GOSUMDB: "${GOSUMDB:-sum.golang.org}" + services: gateway-service: build: context: . dockerfile: services/gateway-service/Dockerfile + args: *go-build-args container_name: gateway-service environment: TZ: UTC @@ -26,6 +31,7 @@ services: build: context: . dockerfile: services/room-service/Dockerfile + args: *go-build-args container_name: room-service environment: TZ: UTC @@ -49,6 +55,7 @@ services: build: context: . dockerfile: services/wallet-service/Dockerfile + args: *go-build-args container_name: wallet-service environment: TZ: UTC @@ -72,6 +79,7 @@ services: build: context: . dockerfile: services/user-service/Dockerfile + args: *go-build-args container_name: user-service environment: TZ: UTC @@ -91,6 +99,7 @@ services: build: context: . dockerfile: services/activity-service/Dockerfile + args: *go-build-args container_name: activity-service environment: TZ: UTC @@ -112,6 +121,7 @@ services: build: context: . dockerfile: services/cron-service/Dockerfile + args: *go-build-args container_name: cron-service environment: TZ: UTC diff --git a/services/activity-service/Dockerfile b/services/activity-service/Dockerfile index f35fe34c..c10ab51e 100644 --- a/services/activity-service/Dockerfile +++ b/services/activity-service/Dockerfile @@ -2,6 +2,11 @@ FROM golang:1.26.3-alpine AS builder WORKDIR /src +# Module proxy is a build-time contract so Docker builds can recover from transient proxy EOFs. +ARG GOPROXY=https://goproxy.cn|https://proxy.golang.org|direct +ARG GOSUMDB=sum.golang.org +ENV GOPROXY=${GOPROXY} GOSUMDB=${GOSUMDB} + COPY go.mod go.sum ./ COPY api/go.mod api/go.sum ./api/ RUN GOWORK=off go mod download diff --git a/services/cron-service/Dockerfile b/services/cron-service/Dockerfile index f3488f50..60cac8e8 100644 --- a/services/cron-service/Dockerfile +++ b/services/cron-service/Dockerfile @@ -2,6 +2,11 @@ FROM golang:1.26.3-alpine AS builder WORKDIR /src +# Module proxy is a build-time contract so Docker builds can recover from transient proxy EOFs. +ARG GOPROXY=https://goproxy.cn|https://proxy.golang.org|direct +ARG GOSUMDB=sum.golang.org +ENV GOPROXY=${GOPROXY} GOSUMDB=${GOSUMDB} + COPY go.mod go.sum ./ COPY api/go.mod api/go.sum ./api/ RUN GOWORK=off go mod download diff --git a/services/gateway-service/Dockerfile b/services/gateway-service/Dockerfile index 601c8bf3..e27123aa 100644 --- a/services/gateway-service/Dockerfile +++ b/services/gateway-service/Dockerfile @@ -2,6 +2,11 @@ FROM golang:1.26.3-alpine AS builder WORKDIR /src +# Module proxy is a build-time contract so Docker builds can recover from transient proxy EOFs. +ARG GOPROXY=https://goproxy.cn|https://proxy.golang.org|direct +ARG GOSUMDB=sum.golang.org +ENV GOPROXY=${GOPROXY} GOSUMDB=${GOSUMDB} + COPY go.mod go.sum ./ COPY api/go.mod api/go.sum ./api/ RUN GOWORK=off go mod download diff --git a/services/room-service/Dockerfile b/services/room-service/Dockerfile index 7f848466..036dbbdd 100644 --- a/services/room-service/Dockerfile +++ b/services/room-service/Dockerfile @@ -2,6 +2,11 @@ FROM golang:1.26.3-alpine AS builder WORKDIR /src +# Module proxy is a build-time contract so Docker builds can recover from transient proxy EOFs. +ARG GOPROXY=https://goproxy.cn|https://proxy.golang.org|direct +ARG GOSUMDB=sum.golang.org +ENV GOPROXY=${GOPROXY} GOSUMDB=${GOSUMDB} + COPY go.mod go.sum ./ COPY api/go.mod api/go.sum ./api/ RUN GOWORK=off go mod download diff --git a/services/user-service/Dockerfile b/services/user-service/Dockerfile index a660eff5..c5f43451 100644 --- a/services/user-service/Dockerfile +++ b/services/user-service/Dockerfile @@ -2,6 +2,11 @@ FROM golang:1.26.3-alpine AS builder WORKDIR /src +# Module proxy is a build-time contract so Docker builds can recover from transient proxy EOFs. +ARG GOPROXY=https://goproxy.cn|https://proxy.golang.org|direct +ARG GOSUMDB=sum.golang.org +ENV GOPROXY=${GOPROXY} GOSUMDB=${GOSUMDB} + COPY go.mod go.sum ./ COPY api/go.mod api/go.sum ./api/ RUN GOWORK=off go mod download diff --git a/services/wallet-service/Dockerfile b/services/wallet-service/Dockerfile index 4f6fe148..64a8d515 100644 --- a/services/wallet-service/Dockerfile +++ b/services/wallet-service/Dockerfile @@ -2,6 +2,11 @@ FROM golang:1.26.3-alpine AS builder WORKDIR /src +# Module proxy is a build-time contract so Docker builds can recover from transient proxy EOFs. +ARG GOPROXY=https://goproxy.cn|https://proxy.golang.org|direct +ARG GOSUMDB=sum.golang.org +ENV GOPROXY=${GOPROXY} GOSUMDB=${GOSUMDB} + COPY go.mod go.sum ./ COPY api/go.mod api/go.sum ./api/ RUN GOWORK=off go mod download