FROM gitea.pena/penadevops/container-images/node:main as build

RUN apk update && rm -rf /var/cache/apk/*
WORKDIR /usr/app
COPY . .

RUN yarn install --ignore-scripts --non-interactive --frozen-lockfile && yarn cache clean
RUN yarn build


FROM gitea.pena/penadevops/container-images/nginx:main as result
WORKDIR /usr/share/nginx/html
COPY --from=build /usr/app/build/ /usr/share/nginx/html
COPY hub.conf /etc/nginx/conf.d/default.conf
