FROM node:lts-slim AS build

RUN npm install -g --omit=optional --omit=dev \
      json-server && \
    npm cache clean --force

COPY init/entrypoint.sh /opt/entrypoint.sh

WORKDIR /data
VOLUME /data

EXPOSE 80

ENTRYPOINT ["bash", "/opt/entrypoint.sh"]
CMD []