SadTalker / Dockerfile
manyone's picture
Update Dockerfile
a0a19eb verified
Raw
History Blame Contribute Delete
1.08 kB
# FORCE Python 3.10
FROM python:3.10
# Set the working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y git ffmpeg
# Copy all files
COPY . .
# Upgrade pip
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
# Install Python requirements
RUN pip install --no-cache-dir -r requirements.txt
# --- FIXES ---
# 1. Fix the "torchvision" error
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
# 2. Downgrade Gradio (Required for SadTalker)
RUN pip install "gradio==3.48.0"
# --- CONFIGURATION (The New Part) ---
# Force Gradio to listen on 0.0.0.0 (Public) without editing app.py
ENV GRADIO_SERVER_NAME="0.0.0.0"
# Force Gradio to use the standard Hugging Face port
ENV GRADIO_SERVER_PORT="7860"
# Start the app with "-u" (Unbuffered).
# This forces Python to print logs IMMEDIATELY so you don't get a blank screen.
CMD ["python", "-u", "app.py"]