From 50ffed28998645ae76c4010108cab963bb38faa8 Mon Sep 17 00:00:00 2001 From: zhaojun <2732810281@qq.com> Date: Fri, 9 Jan 2026 15:19:30 +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 | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/dockerfile b/dockerfile index 252f220..6d01680 100644 --- a/dockerfile +++ b/dockerfile @@ -1,17 +1,30 @@ -# 使用官方Node.js镜像 +# 使用官方 Node.js 镜像 FROM node:22-alpine +# 安装 pnpm +RUN npm install -g pnpm + # 设置工作目录 WORKDIR /build -# 复制整个项目(包括 packages 目录) -COPY . . +# 复制 monorepo 配置文件 +COPY pnpm-workspace.yaml ./ +COPY package.json ./ +COPY pnpm-lock.yaml ./ -# 安装所有依赖(包括 workspace 依赖) -RUN npm install -g pnpm && pnpm install +# 复制所有 workspace 包和应用 +COPY packages ./packages +COPY apps ./apps -# 构建生产版本 +# 使用 pnpm 安装依赖 +RUN pnpm install + +# 先构建所有包 +RUN pnpm --filter @deotaland/ui build +RUN pnpm --filter @deotaland/utils... + +# 构建应用 RUN pnpm run build -# 挂载点提示 -CMD ["echo", "Dist files are ready in /build/dist"] \ No newline at end of file +# 确认构建输出存在 +CMD ["sh", "-c", "find /build -name 'dist' -type d -exec ls -la {} \\;"] \ No newline at end of file