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:
@@ -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
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user