Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +9 -36
Dockerfile
CHANGED
|
@@ -1,66 +1,39 @@
|
|
| 1 |
-
# 1. Use Python 3.10 (Required for stable ML libraries)
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
#
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
-
git \
|
| 10 |
-
git-lfs \
|
| 11 |
-
ffmpeg \
|
| 12 |
-
libsm6 \
|
| 13 |
-
libxext6 \
|
| 14 |
-
cmake \
|
| 15 |
-
rsync \
|
| 16 |
-
libgl1 \
|
| 17 |
-
wget \
|
| 18 |
-
build-essential \
|
| 19 |
&& rm -rf /var/lib/apt/lists/* \
|
| 20 |
&& git lfs install
|
| 21 |
|
| 22 |
-
# 3. Upgrade pip, wheel, and setuptools
|
| 23 |
RUN pip install --no-cache-dir --upgrade pip wheel setuptools
|
| 24 |
|
| 25 |
-
#
|
| 26 |
-
# We strictly use 2.1.2 to match the pre-built wheels for mmcv 2.1.0
|
| 27 |
RUN pip install --no-cache-dir \
|
| 28 |
-
torch==2.1.2+cu118 \
|
| 29 |
-
torchvision==0.16.2+cu118 \
|
| 30 |
-
torchaudio==2.1.2+cu118 \
|
| 31 |
--index-url https://download.pytorch.org/whl/cu118
|
| 32 |
|
| 33 |
-
#
|
| 34 |
-
# Prevents the "No module named pip" error during mmpose install
|
| 35 |
RUN pip install --no-cache-dir --no-build-isolation chumpy
|
| 36 |
|
| 37 |
-
#
|
| 38 |
-
# We install ALL 3 at once with strict versions to prevent auto-upgrade.
|
| 39 |
-
# mmcv==2.1.0 -> The base (Must be < 2.2.0)
|
| 40 |
-
# mmdet==3.2.0 -> Compatible with mmcv 2.1.0
|
| 41 |
-
# mmpose==1.2.0 -> Compatible with mmcv 2.1.0
|
| 42 |
RUN pip install --no-cache-dir openmim && \
|
| 43 |
mim install "mmcv==2.1.0" "mmdet==3.2.0" "mmpose==1.2.0"
|
| 44 |
|
| 45 |
-
#
|
| 46 |
COPY requirements.txt /tmp/requirements.txt
|
| 47 |
RUN pip install --no-cache-dir -r /tmp/requirements.txt
|
| 48 |
|
| 49 |
-
#
|
| 50 |
-
COPY scripts/download_models.sh /app/download_models.sh
|
| 51 |
-
RUN chmod +x /app/download_models.sh && /app/download_models.sh
|
| 52 |
-
|
| 53 |
-
# 9. Copy application code
|
| 54 |
COPY . /app
|
| 55 |
|
| 56 |
-
#
|
| 57 |
RUN mkdir -p /home/user && \
|
| 58 |
([ -e /home/user/app ] || ln -s /app/ /home/user/app) || true
|
| 59 |
|
| 60 |
-
# 11. Launch Configuration
|
| 61 |
EXPOSE 7860
|
| 62 |
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
| 63 |
ENV GRADIO_SERVER_PORT=7860
|
| 64 |
-
|
| 65 |
-
# Start the Gemini Live WebUI
|
| 66 |
CMD ["python", "webui.py"]
|
|
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install system dependencies (including wget for the runtime downloader)
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
+
git git-lfs ffmpeg libsm6 libxext6 cmake rsync libgl1 wget build-essential \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
&& rm -rf /var/lib/apt/lists/* \
|
| 9 |
&& git lfs install
|
| 10 |
|
|
|
|
| 11 |
RUN pip install --no-cache-dir --upgrade pip wheel setuptools
|
| 12 |
|
| 13 |
+
# Install PyTorch 2.1.2
|
|
|
|
| 14 |
RUN pip install --no-cache-dir \
|
| 15 |
+
torch==2.1.2+cu118 torchvision==0.16.2+cu118 torchaudio==2.1.2+cu118 \
|
|
|
|
|
|
|
| 16 |
--index-url https://download.pytorch.org/whl/cu118
|
| 17 |
|
| 18 |
+
# Fix Chumpy
|
|
|
|
| 19 |
RUN pip install --no-cache-dir --no-build-isolation chumpy
|
| 20 |
|
| 21 |
+
# Install OpenMMLab
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
RUN pip install --no-cache-dir openmim && \
|
| 23 |
mim install "mmcv==2.1.0" "mmdet==3.2.0" "mmpose==1.2.0"
|
| 24 |
|
| 25 |
+
# Install Requirements
|
| 26 |
COPY requirements.txt /tmp/requirements.txt
|
| 27 |
RUN pip install --no-cache-dir -r /tmp/requirements.txt
|
| 28 |
|
| 29 |
+
# Copy App Code
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
COPY . /app
|
| 31 |
|
| 32 |
+
# Setup Permissions
|
| 33 |
RUN mkdir -p /home/user && \
|
| 34 |
([ -e /home/user/app ] || ln -s /app/ /home/user/app) || true
|
| 35 |
|
|
|
|
| 36 |
EXPOSE 7860
|
| 37 |
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
| 38 |
ENV GRADIO_SERVER_PORT=7860
|
|
|
|
|
|
|
| 39 |
CMD ["python", "webui.py"]
|