增加构建参数:NPM_DISABLE_SAFE_PERM 表示是否启用不验证npm证书模式,用来解决某些构建环境下npm报错的问题

true:开启
false:关闭

升级node8.0 到 lts版本(10.x)
This commit is contained in:
yaziming
2019-08-16 14:30:36 +08:00
parent f90e9f04a9
commit 5b754a96c7

View File

@@ -8,7 +8,15 @@ ENV GOPROXY https://mirrors.aliyun.com/goproxy/
RUN go install -v ./...
FROM node:8.16.0-alpine AS frontend-build
FROM node:lts-alpine AS frontend-build
ARG NPM_DISABLE_SAFE_PERM=false
RUN if [ ${NPM_DISABLE_SAFE_PERM} = true ]; then \
# run the install
echo "info: use npm unsafe-perm mode" \
&& npm config set unsafe-perm true \
;fi
ADD ./frontend /app
WORKDIR /app