diff --git a/.npmrc b/.npmrc index d9207e7f82..caa2f6e449 100644 --- a/.npmrc +++ b/.npmrc @@ -4,3 +4,4 @@ update-notifier=false package-lock=true save-exact=true lockfile-version=3 +registry=https://registry.npmmirror.com/ diff --git a/Dockerfile.rootless b/Dockerfile.rootless index ccad44b458..ba4427e8bd 100644 --- a/Dockerfile.rootless +++ b/Dockerfile.rootless @@ -9,11 +9,11 @@ ARG RUNTIME_CONTAINER="gitea-runtime-container:v1.0" # stage1: Building Stage FROM ${DOCKER_REGISTRY_ADDRESS}/${DOCKER_REGISTRY_USERNAME}/${DEV_CONTAINER} AS build-env +# 设置 Go 代理 ARG GOPROXY="https://goproxy.cn" -ARG NODEJS_PROXY="http://mirrors.cloud.tencent.com/nodejs-release/" - ENV GOPROXY=${GOPROXY:-direct} -ENV NODE_MIRROR=${NODEJS_PROXY} +# 注:对于 NPM 代理/镜像, 参考仓库 `/.npmrc` 文件下的 `registry` 变量,推荐使用淘宝镜像,即 `registry=https://registry.npmmirror.com/` + ARG GITEA_VERSION # TODO: 适配 https://devstar.cn diff --git a/Makefile b/Makefile index bdeb8878cd..1177ab8bbf 100644 --- a/Makefile +++ b/Makefile @@ -874,6 +874,7 @@ deps-tools: $(GO) install $(GOPLS_PACKAGE) node_modules: package-lock.json + npm config list npm install --no-save @touch node_modules