build(Dockerfile): 使用 pnpm 替代 npm 进行包管理
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
- 移除原有的 npm 安装命令 - 添加 pnpm 的全局安装命令 - 使用 pnpm 配置镜像源 - 替换生产环境中的 npm 安装命令为 pnpm
This commit is contained in:
parent
5aa364e9be
commit
6b768babfd
10
Dockerfile
10
Dockerfile
@ -7,8 +7,10 @@ COPY package.json .
|
|||||||
COPY package-lock.json* .
|
COPY package-lock.json* .
|
||||||
|
|
||||||
# 设置npm镜像
|
# 设置npm镜像
|
||||||
RUN npm config set registry https://registry.npmmirror.com/ && \
|
RUN npm config set registry https://registry.npmmirror.com
|
||||||
npm install
|
|
||||||
|
RUN npm install -g pnpm
|
||||||
|
RUN pnpm config set registry https://registry.npmmirror.com
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
@ -24,8 +26,8 @@ COPY --from=builder /app/package.json .
|
|||||||
COPY --from=builder /app/bootstrap.js .
|
COPY --from=builder /app/bootstrap.js .
|
||||||
|
|
||||||
# 设置npm镜像
|
# 设置npm镜像
|
||||||
RUN npm config set registry https://registry.npmmirror.com/ && \
|
RUN pnpm config set registry https://registry.npmmirror.com
|
||||||
npm install --production
|
RUN pnpm install --production
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV PORT=8001
|
ENV PORT=8001
|
||||||
|
Loading…
Reference in New Issue
Block a user