File size: 1,676 Bytes
0f8a584 ac91894 0f8a584 ac91894 0f8a584 18afa85 0f8a584 ac91894 3da5127 0f8a584 964fd91 18afa85 0f8a584 18afa85 0f8a584 3da5127 0f8a584 3da5127 0f8a584 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common \
ca-certificates \
curl \
gnupg \
build-essential \
git \
ffmpeg \
libgl1 \
libglvnd-dev \
libglib2.0-0 \
libvulkan1 \
vulkan-tools \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update && apt-get install -y --no-install-recommends \
python3.11 \
python3.11-dev \
python3.11-venv \
&& curl -sS https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py \
&& python3.11 /tmp/get-pip.py \
&& ln -sf /usr/bin/python3.11 /usr/local/bin/python \
&& ln -sf /usr/bin/python3.11 /usr/local/bin/python3 \
&& ln -sf /usr/local/bin/pip /usr/local/bin/pip3 \
&& rm -f /tmp/get-pip.py \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -m -u 1000 user
ENV PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics \
HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
OMP_NUM_THREADS=1 \
PORT=7860
WORKDIR /home/user/app
RUN mkdir -p /home/user/app/temp_demos \
&& chown -R user:user /home/user
COPY --chown=user:user requirements.txt ./
USER user
RUN python3 -m pip install --user --upgrade pip setuptools wheel \
&& python3 -m pip install --user -r requirements.txt
COPY --chown=user:user docker-entrypoint.sh ./
COPY --chown=user:user gradio-web ./gradio-web
COPY --chown=user:user src ./src
RUN chmod +x /home/user/app/docker-entrypoint.sh
EXPOSE 7860
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ["python3", "gradio-web/main.py"]
|