FROM node:16 as build

WORKDIR /usr/src/app

COPY . .
RUN npm install
RUN npm run build

FROM alpine:3.18.3 as release
COPY --from=build /usr/src/app/dist /html
ADD entrypoint.sh /

RUN apk update
RUN apk add rsync

ENTRYPOINT ["/entrypoint.sh"]
RUN chmod +x /entrypoint.sh