FROM node:20-alpine as builder WORKDIR /app # 安装依赖 COPY frontend/package*.json ./ RUN npm ci # 构建 COPY frontend/ . RUN npm run build # 生产镜像 FROM nginx:alpine COPY --from=builder /app/dist /usr/share/nginx/html COPY deploy/nginx/frontend.conf /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]