FROM registry.yandex.net/ubuntu:focal
MAINTAINER Meshcheriakov Aleksei <aleksei-m@yandex-team.ru>

RUN DEBIAN_FRONTEND=noninterative apt-get update && apt-get -y install libssl-dev python3-pip python3.8 git wget && python3 -m pip install --upgrade pip==22.0.3

RUN wget https://crls.yandex.net/YandexInternalRootCA.crt -O /usr/local/share/ca-certificates/YandexInternalRootCA.crt
RUN update-ca-certificates

COPY . /app
WORKDIR /app

# This needs to be done via xargs because certifi-yandex needs to be intalled after orgiginal certifi as it overswrites original files
RUN cat requirements.txt | xargs -n 1 -L 1 python3 -m pip install -i https://pypi.yandex-team.ru/simple/
ENTRYPOINT ["python3"]
CMD ["run.py"]
EXPOSE 80
