build(Dockerfile): 使用 pnpm 替代 npm 安装依赖
Some checks failed
continuous-integration/drone/push Build is failing

- 全局安装 pnpm
- 配置 pnpm 使用国内代理
- 使用 pnpm 安装生产环境依赖
- 移除 npm 相关代码
This commit is contained in:
lixin 2025-01-10 12:57:37 +08:00
parent 9c97d2dc3b
commit eecc828ac0

View File

@ -17,14 +17,15 @@ RUN npm config set registry https://registry.npmmirror.com
# 安装开发期依赖
COPY package.json ./package.json
RUN npm install
RUN npm install -g pnpm
RUN pnpm config set registry https://registry.npmmirror.com
# 构建项目
COPY . .
RUN npm run build
# 删除开发期依赖
RUN rm -rf node_modules && rm package-lock.json
# 安装生产环境依赖
RUN npm install --production
RUN pnpm install
# 如果端口更换,这边可以更新一下
EXPOSE 8001