FROM python:3.11-slim ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 ENV DEBIAN_FRONTEND=noninteractive # System packages RUN apt-get update && apt-get install -y \ ffmpeg \ git \ curl \ build-essential \ libgl1 \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* # Working directory WORKDIR /app # Create directories you will write to RUN mkdir -p /app /app/data /app/tmp /app/logs # 🔥 FULL PERMISSION FIX (IMPORTANT) RUN chmod -R 777 /app && chown -R 1000:1000 /app # Copy requirements first COPY requirements.txt /app/requirements.txt RUN pip install --upgrade pip RUN pip install -r /app/requirements.txt # Copy ALL source code COPY . /app # 🔥 APPLY AGAIN AFTER COPY (CRITICAL) RUN chmod -R 777 /app && chown -R 1000:1000 /app # HF default port EXPOSE 7860 CMD ["python", "app.py"]