FROM node AS build
WORKDIR /app
ENV PATH ./node_modules/.bin:$PATH
COPY package.json .
RUN yarn

COPY . .

ARG KANBAN_API_URL
RUN sh create-env-file.sh ${KANBAN_API_URL}

RUN yarn build

FROM nginx
COPY --from=build /app/nginx/nginx.conf /etc/nginx/
COPY --from=build /app/build /usr/share/nginx/html
EXPOSE 80
