FROM node:16
WORKDIR /app

COPY package*.json ./

RUN npm install --include=dev

# 3. 复制源代码
COPY . .

# 4. 执行构建
RUN npm run build:h5

# 生产阶段
FROM nginx:stable-alpine
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 8333
CMD ["nginx", "-g", "daemon off;"]
