FROM node:20-alpine

# 安装 pnpm
RUN npm install -g pnpm@latest

WORKDIR /app

# 复制 package.json
COPY packages/shared/package.json ./
COPY pnpm-lock.yaml pnpm-workspace.yaml ./

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

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

# 暴露端口
EXPOSE 5000

# 开发模式启动（支持热更新）
CMD ["pnpm", "dev", "--host", "0.0.0.0"]
