# First stage builds the frontend FROM node:16-alpine as build WORKDIR /src COPY . /src RUN npm install --no-progress RUN npm run production # Second stage just expose the built file FROM nginx:alpine EXPOSE 80 RUN rm /etc/nginx/conf.d/default.conf && mkdir /frontend COPY docker/front.conf /etc/nginx/conf.d/front.conf COPY --from=build /src/dist /frontend CMD nginx -g 'daemon off;'