From 78079e94e17e88ba59791dbc69d9697d616ef3d6 Mon Sep 17 00:00:00 2001 From: zhaojun <2732810281@qq.com> Date: Fri, 9 Jan 2026 13:17:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dockerfile | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/dockerfile b/dockerfile index 7de0004..d5a09df 100644 --- a/dockerfile +++ b/dockerfile @@ -1,13 +1,23 @@ -# Dockerfile.simple +# 使用官方Node.js镜像 FROM node:20-alpine -WORKDIR /build +# 安装 pnpm +RUN npm install -g pnpm +# 设置工作目录 +WORKDIR /app + +# 复制整个项目(包括 packages 目录) COPY . . -RUN npm install && npm run build -# 直接进入构建目录 -WORKDIR /build +# 使用国内镜像源 +RUN pnpm config set registry https://registry.npmmirror.com/ + +# 安装所有依赖(包括 workspace 依赖) +RUN pnpm install + +# 构建生产版本 +RUN pnpm run build # 挂载点提示 CMD ["echo", "Dist files are ready in /build/dist"] \ No newline at end of file