This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
# 阶段1: 构建阶段
FROM node:22.14.0-slim AS builder
WORKDIR /app
# 全局安装 pnpm
RUN npm install -g pnpm
# 复制依赖文件
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --registry https://registry.npmmirror.com
# 复制源码并构建
COPY . .
RUN pnpm run build:prod
# 阶段2: 生产运行阶段
FROM node:22.14.0-slim
WORKDIR /app
# 全局安装 pnpm(确保运行时可用)
RUN npm install -g pnpm --registry https://registry.npmmirror.com