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:24.7.0-slim AS builder
WORKDIR /app
RUN npm config set registry https://registry.npmmirror.com \
&& npm install -g pnpm \
&& pnpm config set registry https://registry.npmmirror.com
# 复制依赖文件
COPY package.json pnpm-lock.yaml ./
# 【合并2】强制安装依赖
RUN pnpm install --force \
&& pnpm add -D @unocss/eslint-plugin
COPY . .
# 执行生产构建(和你本地的build:prod命令一致)
RUN pnpm run build:prod
# 阶段2: 生产运行阶段
FROM node:24.7.0-slim
WORKDIR /app
# 【合并3】设置npm镜像源 + 全局安装pnpm + 设置pnpm镜像源
RUN npm config set registry https://registry.npmmirror.com \
&& npm install -g pnpm \
&& pnpm config set registry https://registry.npmmirror.com