FROM node:14 as build

WORKDIR /app

COPY . ./

RUN yarn
RUN yarn parcel build index.html contact.html team.html project.html 

COPY js/brain.json dist/js/brain.json

FROM nginx:latest as serve

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

EXPOSE 80