Dockerfile 363 B

123456789101112131415
  1. FROM node:lts-alpine
  2. # build stage
  3. FROM node:lts-alpine as build-stage
  4. WORKDIR /app
  5. COPY package*.json ./
  6. RUN npm install
  7. COPY . .
  8. RUN npm run build
  9. # production stage
  10. FROM nginx:stable-alpine as production-stage
  11. COPY ./nginx.conf /etc/nginx/conf.d/default.conf
  12. COPY --from=build-stage /app/dist /usr/share/nginx/html
  13. EXPOSE 80
  14. CMD ["nginx", "-g", "daemon off;"]