fix(build): make Go GOPROXY a compose build arg for restricted networks

Default GOPROXY stays proxy.golang.org to preserve upstream behavior;
hosts that cannot reach it pass GO_PROXY (e.g. goproxy.cn) via the env
file. Wires app+events build args across dev/test/main compose.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
weichen
2026-09-22 12:26:05 +08:00
co-authored by Cursor
parent b885505d68
commit 517b9646bf
4 changed files with 18 additions and 0 deletions
+6
View File
@@ -11,6 +11,12 @@ RUN npm run build
FROM golang:1.23-bookworm AS go-builder
# GOPROXY defaults to the official proxy to preserve upstream build behavior.
# Hosts behind networks that cannot reach proxy.golang.org can pass a
# reachable mirror, e.g. --build-arg GOPROXY=https://goproxy.cn,direct
# (compose wires it from GO_PROXY in the environment env-file).
ARG GOPROXY=https://proxy.golang.org,direct
ENV GOPROXY=${GOPROXY}
ENV GOTOOLCHAIN=auto
WORKDIR /src
+4
View File
@@ -71,6 +71,8 @@ services:
build:
context: .
dockerfile: deploy/app/Dockerfile
args:
GOPROXY: ${GO_PROXY:-https://proxy.golang.org,direct}
container_name: shuimu-agent-app-dev
depends_on:
system-db:
@@ -152,6 +154,8 @@ services:
build:
context: .
dockerfile: deploy/app/Dockerfile
args:
GOPROXY: ${GO_PROXY:-https://proxy.golang.org,direct}
container_name: shuimu-agent-events-dev
entrypoint: ["/app/events"]
command: ["-env", "/dev/null"]
+4
View File
@@ -68,6 +68,8 @@ services:
build:
context: .
dockerfile: deploy/app/Dockerfile
args:
GOPROXY: ${GO_PROXY:-https://proxy.golang.org,direct}
container_name: shuimu-agent-app-main
depends_on:
system-db:
@@ -152,6 +154,8 @@ services:
build:
context: .
dockerfile: deploy/app/Dockerfile
args:
GOPROXY: ${GO_PROXY:-https://proxy.golang.org,direct}
container_name: shuimu-agent-events-main
entrypoint: ["/app/events"]
command: ["-env", "/dev/null"]
+4
View File
@@ -68,6 +68,8 @@ services:
build:
context: .
dockerfile: deploy/app/Dockerfile
args:
GOPROXY: ${GO_PROXY:-https://proxy.golang.org,direct}
container_name: shuimu-agent-app-test
depends_on:
system-db:
@@ -149,6 +151,8 @@ services:
build:
context: .
dockerfile: deploy/app/Dockerfile
args:
GOPROXY: ${GO_PROXY:-https://proxy.golang.org,direct}
container_name: shuimu-agent-events-test
entrypoint: ["/app/events"]
command: ["-env", "/dev/null"]