FROM ubuntu:bionic AS frontend RUN apt-get update && \ apt-get install -y wget software-properties-common && \ echo "deb https://deb.nodesource.com/node_10.x bionic main" | tee /etc/apt/sources.list.d/nodesource.list && \ wget -q -O- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \ apt-get update && \ apt-get install -y nodejs ADD . /tmp/code/ RUN cd /tmp/code && \ npm install && \ ./node_modules/.bin/grunt FROM ubuntu:disco AS app ADD . /tmp/code/ RUN apt-get update && \ apt-get install -y python3-pip COPY --from=frontend /tmp/code/styles/dist/style.css /tmp/code/styles/dist/style.css RUN cd /tmp/code && \ pip3 install -r requirements.txt && \ python3 setup.py install && \ useradd --uid 1000 app && \ rm -rf /tmp/code VOLUME /srv/library VOLUME /srv/cache VOLUME /srv/db USER app ENV CACHE_URL=file://./tmp/cache ENTRYPOINT ["photoappd"]