FROM node:20-alpine

RUN npm install -g pnpm@latest

WORKDIR /app

# 复制依赖文件
COPY packages/portal/package.json ./
COPY pnpm-lock.yaml pnpm-workspace.yaml ./

# 安装依赖
RUN pnpm install --frozen-lockfile

# 复制源代码
COPY packages/portal/ ./

# 暴露端口
EXPOSE 3000

# 开发模式（HMR）
CMD ["pnpm", "dev", "--host", "0.0.0.0"]
