FROM alpine:latest as builder

RUN apk add --update nodejs npm supervisor

WORKDIR  /var/www
COPY package*.json ./

RUN npm install --legacy-peer-deps && npm cache clean --force

COPY .docker/supervisord.conf /etc/supervisord.conf

RUN chmod +rwx /var/www
RUN chmod -R 777 /var/www

EXPOSE 7216
CMD ["supervisord", "-c", "/etc/supervisord.conf"]
