Update Dockerfile
Browse files- Dockerfile +16 -11
Dockerfile
CHANGED
|
@@ -4,29 +4,34 @@ FROM python:3.10
|
|
| 4 |
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Install
|
| 8 |
RUN apt-get update && apt-get install -y git ffmpeg
|
| 9 |
|
| 10 |
-
# Copy
|
| 11 |
COPY . .
|
| 12 |
|
| 13 |
# Upgrade pip
|
| 14 |
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
|
| 15 |
|
| 16 |
-
# Install requirements
|
| 17 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
-
# ---
|
| 20 |
|
| 21 |
-
# 1. Fix the torchvision
|
| 22 |
RUN sed -i 's/from torchvision.transforms.functional_tensor import rgb_to_grayscale/from torchvision.transforms.functional import rgb_to_grayscale/g' /usr/local/lib/python3.10/site-packages/basicsr/data/degradations.py
|
| 23 |
|
| 24 |
-
# 2. Downgrade Gradio
|
| 25 |
RUN pip install "gradio==3.48.0"
|
| 26 |
|
| 27 |
-
#
|
| 28 |
-
# This finds "demo.launch(" and replaces it with "demo.launch(server_name='0.0.0.0', server_port=7860,"
|
| 29 |
-
RUN sed -i "s/demo.launch(/demo.launch(server_name='0.0.0.0', server_port=7860, /g" app.py
|
| 30 |
|
| 31 |
-
#
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Install system dependencies
|
| 8 |
RUN apt-get update && apt-get install -y git ffmpeg
|
| 9 |
|
| 10 |
+
# Copy all files
|
| 11 |
COPY . .
|
| 12 |
|
| 13 |
# Upgrade pip
|
| 14 |
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
|
| 15 |
|
| 16 |
+
# Install Python requirements
|
| 17 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
+
# --- FIXES ---
|
| 20 |
|
| 21 |
+
# 1. Fix the "torchvision" error
|
| 22 |
RUN sed -i 's/from torchvision.transforms.functional_tensor import rgb_to_grayscale/from torchvision.transforms.functional import rgb_to_grayscale/g' /usr/local/lib/python3.10/site-packages/basicsr/data/degradations.py
|
| 23 |
|
| 24 |
+
# 2. Downgrade Gradio (Required for SadTalker)
|
| 25 |
RUN pip install "gradio==3.48.0"
|
| 26 |
|
| 27 |
+
# --- CONFIGURATION (The New Part) ---
|
|
|
|
|
|
|
| 28 |
|
| 29 |
+
# Force Gradio to listen on 0.0.0.0 (Public) without editing app.py
|
| 30 |
+
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
| 31 |
+
|
| 32 |
+
# Force Gradio to use the standard Hugging Face port
|
| 33 |
+
ENV GRADIO_SERVER_PORT="7860"
|
| 34 |
+
|
| 35 |
+
# Start the app with "-u" (Unbuffered).
|
| 36 |
+
# This forces Python to print logs IMMEDIATELY so you don't get a blank screen.
|
| 37 |
+
CMD ["python", "-u", "app.py"]
|