|
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04 |
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
python3.10 \ |
|
python3-pip \ |
|
ffmpeg \ |
|
tzdata \ |
|
&& apt-get clean \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \ |
|
dpkg-reconfigure --frontend noninteractive tzdata |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY ./requirements.txt /app/requirements.txt |
|
RUN python3 -m pip install --upgrade pip \ |
|
&& python3 -m pip install --no-cache-dir --upgrade -r /app/requirements.txt |
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
|
|
|
|
ENV HOME=/home/user \ |
|
PATH=/home/user/.local/bin:$PATH \ |
|
CUDA_HOME=/ |
|
|
|
|
|
USER user |
|
WORKDIR $HOME/app |
|
|
|
|
|
COPY --chown=user . $HOME/app |
|
|
|
|
|
RUN chmod -R 777 $HOME/app |
|
|
|
|
|
ENV NUMBA_CACHE_DIR=/tmp/NUMBA_CACHE_DIR/ |
|
ENV MPLCONFIGDIR=/tmp/MPLCONFIGDIR/ |
|
ENV PATH="/opt/venv/bin:$PATH" |
|
|
|
|
|
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |