# 切换node
|
FROM 172.21.81.239:32002/node/node:20.15.0-alpine AS build-env
|
|
# 设置工作目录
|
WORKDIR /app
|
|
# 统一 pnpm 版本(避免 lockfile 不一致)
|
RUN npm install -g pnpm@10.27.0
|
|
## 让 sharp 走镜像源(避免 GitHub 下载失败)
|
ENV npm_config_sharp_binary_host=https://npmmirror.com/mirrors/sharp
|
ENV npm_config_sharp_libvips_binary_host=https://npmmirror.com/mirrors/sharp-libvips
|
|
# 将父级目录复制到容器
|
COPY . .
|
|
# 安装项目依赖
|
RUN pnpm install --no-frozen-lockfile --registry=https://registry.npmmirror.com
|
|
# 构建项目
|
RUN pnpm run build:test:drone-command
|
|
# 查看
|
RUN ls /app/applications/drone-command/dist
|