diff --git a/Dockerfile b/Dockerfile index 25c9459..de299a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,12 @@ -FROM node:lts-alpine as builder - +# build stage +FROM node:lts-hydrogen AS build-stage WORKDIR /app -COPY . ./ -RUN npm install && npm run build - -FROM nginx:alpine +COPY package*.json ./ +RUN npm install +COPY . . +RUN npm run build -COPY --from=builder /app/dist /usr/share/nginx/html \ No newline at end of file +FROM nginx:stable-alpine AS production-stage +COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=build-stage /app/dist /usr/share/nginx/html +CMD ["nginx", "-g", "daemon off;"]