FROM node:10-alpine as react-build
LABEL maintainer="Michael Winsauer <e1429715@student.tuwien.ac.at>"

WORKDIR /app
COPY . ./

RUN ["yarn", "install"]
RUN ["yarn", "build"]


FROM nginx:alpine
LABEL maintainer="Michael Winsauer <e1429715@student.tuwien.ac.at>"

EXPOSE 8080

COPY --from=react-build /app/build /usr/share/nginx/html
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf

CMD ["nginx", "-g", "daemon off;"]