FROM registry.yandex.net/maillists/base:latest

ENV LC_ALL="C.UTF-8"
ENV LANG="C.UTF-8"
RUN locale-gen "en_US.UTF-8" && locale > /etc/default/locale

COPY requirements /requirements

RUN mkdir -p /etc/uwsgi/apps-enabled\
        /etc/yandex/tools-maillists\
        /etc/maillists-settings\
        /var/lib/yandex/tools-maillists

RUN apt-get update \
    && apt-get install -y \
        git\
        python-dev\
        gcc \
        build-essential \
        cython \
        pkg-config\
    && pip install wheel setuptools \
    && pip install -r /requirements/base.txt \
    && apt-get purge -y \
        git\
        python-dev\
        gcc \
        build-essential \
        cython \
        pkg-config\
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* \
    && rm -rf /root/.cache/ \
    && echo DONE

