# Build stage | |
#FROM registry.cn-hangzhou.aliyuncs.com/library/node:18-alpine as build-stage | |
FROM node:18-alpine AS build | |
WORKDIR /app | |
COPY package*.json ./ | |
RUN npm install | |
COPY .. . | |
RUN npm run build | |
# Production stage | |
#FROM registry.cn-hangzhou.aliyuncs.com/library/nginx:stable-alpine as production-stage | |
FROM nginx:stable-alpine AS base | |
COPY --from=build /app/dist /usr/share/nginx/html | |
EXPOSE 80 | |
CMD ["nginx", "-g", "daemon off;"] |