FROM python:3.10-slim # Install system binaries and fonts RUN apt-get update && apt-get install -y \ ffmpeg \ wget \ libmagic1 \ fonts-dejavu-core \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Create temp dir and set permissions for HF user RUN mkdir -p /app/temp && chmod 777 /app/temp COPY requirements.txt . RUN pip install --no-cache-dir -U yt-dlp && \ pip install --no-cache-dir -r requirements.txt COPY . . # Set permissions for the entire app dir to avoid runtime write issues RUN chmod -R 777 /app ENV PYTHONUNBUFFERED=1 ENV TEMP_DIR=/app/temp EXPOSE 7860 CMD ["python", "app.py"]