FROM node:12.14-stretch AS builder WORKDIR /opt/baphomet COPY . /opt/baphomet RUN cd /opt/baphomet \ && npm install \ && npm run build FROM node:12.14-stretch WORKDIR /opt/baphomet COPY . /opt/baphomet ENV NODE_ENV=production ENV LOG_LEVEL=warn RUN rm -rf /opt/baphomet/src \ && mkdir /opt/baphomet/log COPY --from=builder /opt/baphomet/dist /opt/baphomet/dist RUN cd /opt/baphomet \ && npm install --only=prod \ && chmod +x entrypoint.sh ENTRYPOINT [ "./entrypoint.sh" ] CMD [ "run" ]