# Use an official Python runtime as a parent image
FROM registry.yandex.net/ubuntu:xenial
MAINTAINER Anton Grigoryev <griganton@yandex-team.ru>

ENV WORKDIR /localization-admin
# Set the working directory to
WORKDIR $WORKDIR
ENV PIP_DEFAULT_TIMEOUT 120

# debian dependencies
RUN apt-get update && apt-get install -y --force-yes \
    python-dev \
    # cryptography
    build-essential \
    libssl-dev \
    libffi-dev

RUN apt-get install python-pip -y --allow-change-held-packages --allow-downgrades && pip install --upgrade pip
RUN pip install setuptools

COPY deploy/supervisord.conf /etc/supervisord.conf
RUN pip install supervisor

# install python packages
COPY src/requirements.txt requirements.txt
RUN pip install -r requirements.txt

# Copy the current directory contents into the container at /app
COPY src .

# start ginucorn
CMD ["/usr/local/bin/supervisord"]
