FROM python:3.4.3
RUN apt-get update -y
RUN apt-get install openjdk-7-jdk -y

WORKDIR /var/app
ADD . /var/app

RUN mkdir -p /root/.ssh
ADD id_rsa /root/.ssh/id_rsa
RUN chmod 700 /root/.ssh/id_rsa
RUN ssh-keyscan -H github.com >> /root/.ssh/known_hosts \
    && chmod 600 /root/.ssh/known_hosts
RUN echo 'Host github.com\n\tStrictHostKeyChecking no\n' >> ~/.ssh/config
RUN pip install -U pip
RUN pip install -r reqs.pip
RUN pip install .
RUN apt-get install supervisor -y
RUN mkdir /tmp/aggr_workspace
RUN chmod 755 /tmp/aggr_workspace
ENTRYPOINT ["/usr/bin/supervisord", "-c", "conf/supervisor.conf"]
EXPOSE 9001
