diff --git a/Dockerfile b/Dockerfile index e9791e8..de299a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,12 @@ - -# stage1 as builder -FROM node:16-alpine as builder -# Copy the package.json and install dependencies +# build stage +FROM node:lts-hydrogen AS build-stage +WORKDIR /app COPY package*.json ./ RUN npm install -# Copy rest of the files COPY . . -# Build the project RUN npm run build - -FROM nginx:alpine as production-build -COPY nginx.conf /etc/nginx/nginx.conf -## Remove default nginx index page -RUN rm -rf /usr/share/nginx/html/* -# Copy from the stage 1 -COPY --from=builder /dist /usr/share/nginx/html/nested-app -CMD ["nginx", "-g", "daemon off;"] \ 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;"]