FROM pytorch/pytorch:1.13.0-cuda11.6-cudnn8-devel

RUN set -x && \
    echo "Acquire { HTTP { Proxy \"$HTTP_PROXY\"; }; };" | tee /etc/apt/apt.conf

ARG INSTALL_DIR=/opt
ARG BUILD_DIR=/app

WORKDIR $BUILD_DIR

COPY . $BUILD_DIR

ENV CUDA_PATH /usr/local/cuda
ENV TZ=Europe/Moscow

RUN export HF_DATASETS_CACHE="/app/hf_cache"

# RUN rm /etc/apt/sources.list.d/cuda-ubuntu2204-x86_64.list

RUN apt-get update && \
    apt-get install --no-install-recommends -y \
    wget unzip cmake git

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN ln -sf $(which python3) /usr/bin/python && \
    ln -sf $(which pip3) /usr/bin/pip

ENV	LC_CTYPE en_US.UTF-8
ENV	LANG en_US.UTF-8

RUN pip install --upgrade pip
RUN pip install -r requirements.txt
RUN pip install -e .