| FROM python:3.10-slim | |
| WORKDIR /app | |
| # Install system dependencies including FFmpeg dev libs (required by av/demucs) | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| git \ | |
| git-lfs \ | |
| ffmpeg \ | |
| libavformat-dev \ | |
| libavcodec-dev \ | |
| libavdevice-dev \ | |
| libavutil-dev \ | |
| libavfilter-dev \ | |
| libswscale-dev \ | |
| libswresample-dev \ | |
| pkg-config \ | |
| libsm6 \ | |
| libxext6 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy and install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu -r requirements.txt | |
| # Copy app files | |
| COPY . . | |
| # Create non-root user for HF Spaces | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| EXPOSE 7860 | |
| CMD ["python", "app.py"] |