Skip to content

build: optional npm and Go module mirrors for source builds - #1071

Open
chenhonggang0623-sketch wants to merge 2 commits into
Tencent:mainfrom
chenhonggang0623-sketch:fix/dev-build-mirrors
Open

chenhonggang0623-sketch wants to merge 2 commits into
Tencent:mainfrom
chenhonggang0623-sketch:fix/dev-build-mirrors

Conversation

@chenhonggang0623-sketch

Copy link
Copy Markdown

Motivation

A source build (./start.sh dev) runs npm ci, npm install -g and go mod download inside Docker. On networks where the build container cannot reach registry.npmjs.org or proxy.golang.org the build fails with no supported override — MIRROR only redirects GHCR image pulls.

This was hit while validating a local dev stack against a mirror-only network; both steps failed with TLS/network errors and the only workaround was editing the Dockerfile locally.

What changes

  • NPM_REGISTRY build arg, passed to the chatbot npm ci and the runtime npm install -g steps.
  • GOPROXY build arg for the Go build stage (sets GOPROXY in that stage).
  • Both are wired through compose.dev.yaml from the environment or .env, documented in docs/deployment.md and the start.sh header.
  • Empty values keep each tool's own default, so published-image installs and default networks are unchanged.

Usage

NPM_REGISTRY=https://registry.npmmirror.com GOPROXY=https://goproxy.cn ./start.sh dev

./start.sh dev with both mirrors was built and started successfully locally; the seeded SOP ran script → human gate → approval → completion.

🤖 Generated with Claude Code

陈洪刚 and others added 2 commits November 18, 2026 23:13
Source builds run `npm ci` and `npm install -g` inside Docker. On
networks where the build container cannot reach registry.npmjs.org the
build fails with no supported override: MIRROR only redirects GHCR
image pulls.

Pass NPM_REGISTRY as an optional build arg from compose.dev.yaml, so
`NPM_REGISTRY=https://registry.npmmirror.com ./start.sh dev` (or the
same value in .env) reaches both npm steps. Empty keeps npm's default.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Source builds run `npm ci` and `go mod download` inside Docker. On
networks where the build container cannot reach registry.npmjs.org or
proxy.golang.org, the build fails with no supported override: MIRROR
only redirects GHCR image pulls.

- NPM_REGISTRY is passed to the chatbot and runtime npm installs.
- GOPROXY is passed to the Go build stage.
Both default to empty, which keeps each tool's own default.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant