fix: default npm registry mirror for docker build
This commit is contained in:
@@ -7,7 +7,7 @@ WORKDIR /app
|
||||
# 可选:使用哪种包管理器构建(默认 pnpm;也可传 npm)
|
||||
ARG PKG_MANAGER=pnpm
|
||||
# 可选:镜像加速(例如 https://registry.npmmirror.com)
|
||||
ARG NPM_REGISTRY=
|
||||
ARG NPM_REGISTRY=https://registry.npmmirror.com
|
||||
|
||||
ENV CI=true
|
||||
|
||||
@@ -19,7 +19,9 @@ RUN if [ -n "$NPM_REGISTRY" ]; then npm config set registry "$NPM_REGISTRY"; fi
|
||||
|
||||
RUN set -eux; \
|
||||
if [ "$PKG_MANAGER" = "pnpm" ]; then \
|
||||
npm i -g pnpm@9 && pnpm i --frozen-lockfile; \
|
||||
npm i -g pnpm@9; \
|
||||
if [ -n "$NPM_REGISTRY" ]; then pnpm config set registry "$NPM_REGISTRY"; fi; \
|
||||
pnpm i --frozen-lockfile; \
|
||||
elif [ "$PKG_MANAGER" = "npm" ]; then \
|
||||
npm ci --no-audit --fund=false; \
|
||||
else \
|
||||
|
||||
Reference in New Issue
Block a user