# 使用 Node 镜像构建
FROM node:14-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
# 生成 dist/build/h5 目录
RUN npm run build

# 使用 Nginx 镜像运行
FROM nginx:1.21-alpine
COPY --from=builder /app/dist/build/h5 /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf  # 复制 Nginx 配置
EXPOSE 8333
CMD ["nginx", "-g", "daemon off;"]
