FROM python:3.6
MAINTAINER Dorian Pula <dorian.pula@amber-penguin-software.ca>

RUN wget https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb \
    && dpkg -i dumb-init_*.deb
COPY requirements* /app/rookeries/
RUN apt-get install libpq-dev
RUN pip install --requirement /app/rookeries/requirements.txt --quiet

COPY . /app/rookeries/
WORKDIR /app/rookeries/
RUN chown www-data . --recursive \
    && chgrp www-data . --recursive
USER www-data
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["inv", "server.run"]
EXPOSE 5000
