|
FROM nvidia/cuda:12.1.1-devel-ubuntu22.04 |
|
|
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY ./requirements.txt /app/requirements.txt |
|
|
|
|
|
RUN apt update && apt install -y python3 python3-pip |
|
|
|
RUN python3 -m pip install --no-cache-dir --upgrade -r /app/requirements.txt |
|
RUN apt update && apt install -y ffmpeg |
|
|
|
RUN useradd -m -u 1000 user |
|
|
|
|
|
ENV HOME=/home/user \ |
|
PATH=/home/user/.local/bin:$PATH |
|
|
|
|
|
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 HOME=/home/user |
|
ENV PATH="/opt/venv/bin:$PATH" |
|
|
|
|
|
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |