FROM python:3.10-slim # Install system dependencies RUN apt-get update && apt-get install -y \ ffmpeg \ git \ wget \ curl \ build-essential \ && rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /home/user/app # Copy requirements first for better caching COPY requirements.txt . # Install PyTorch first (matching the version used in Hugging Face) RUN pip install --no-cache-dir torch==2.8.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu # Install mmcv-full with pre-built wheel (this is the key optimization) RUN pip install --no-cache-dir mmcv-full -f https://download.openmmlab.com/mmcv/dist/cpu/torch2.8/index.html # Install other dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy the application code COPY . . # Create necessary directories RUN mkdir -p models/musetalk models/musetalkV15 models/syncnet models/dwpose models/face-parse-bisent models/sd-vae models/whisper # Set environment variables ENV PYTHONPATH=/home/user/app ENV HF_HOME=/home/user/app/.cache/huggingface # Expose port EXPOSE 7860 # Run the application CMD ["python", "app.py"]