优化代码

This commit is contained in:
paulGao
2022-06-16 09:21:14 +08:00
parent 273fdf2e84
commit c85d488de4
9 changed files with 58 additions and 28 deletions

View File

@@ -1,8 +1,13 @@
FROM nginx:alpine
FROM node:10.19.0 as build-stage
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
RUN mkdir -p /app/
COPY ./dist /app/
# production stage
FROM nginx:stable-alpine as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY ./nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]k