FROM node:17.9.1 AS app WORKDIR /app COPY package.json /app/package.json RUN npm install COPY . . ARG REACT_APP_ENDPOINT ENV REACT_APP_ENDPOINT $REACT_APP_ENDPOINT RUN npm run build FROM nginx:alpine WORKDIR /usr/share/nginx/html RUN rm -rf ./* COPY --from=app /app/build . COPY nginx/default.conf /etc/nginx/conf.d/default.conf EXPOSE 80 ENTRYPOINT ["nginx", "-g", "daemon off;"]