FROM meadml/cuda10.1-cudnn7-devel-ubuntu18.04-python3.6
ENV PATH="/root/miniconda3/bin:${PATH}"
ARG PATH="/root/miniconda3/bin:${PATH}"

WORKDIR /app

RUN apt-get update

RUN apt-get install -y wget && rm -rf /var/lib/apt/lists/*

RUN python3 -V
RUN wget \
    https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
    && mkdir /root/.conda \
    && bash Miniconda3-latest-Linux-x86_64.sh -b \
    && rm -f Miniconda3-latest-Linux-x86_64.sh 

RUN conda --version
RUN conda install faiss-gpu cudatoolkit=10.1 -c pytorch # For CUDA10

RUN python3 -V
COPY requirements.txt /app
RUN pip install -r requirements.txt

COPY . /app

RUN python nltk_downloader.py

CMD ["python", "app.py"]
