FROM nvidia/cuda:11.8.0-base-ubuntu22.04 WORKDIR /code ENV DEBIAN_FRONTEND=noninteractive RUN apt update RUN apt install software-properties-common -y RUN add-apt-repository ppa:deadsnakes/ppa RUN apt install -y python3.10 python3.10-distutils RUN apt-get install -y curl RUN curl https://bootstrap.pypa.io/23.1.2/get-pip.py -o get-pip.py && python3.10 get-pip.py && rm get-pip.py RUN apt-get install -y git-all COPY ./requirements.txt /code/requirements.txt RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH ENV CUDA_VISIBLE_DEVICES=0,1,2 WORKDIR $HOME/app COPY --chown=user . $HOME/app CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]