# Use a lightweight Python image FROM python:3.11.5 # Install system dependencies for OpenCV, MoviePy, and general processing RUN apt-get update && apt-get install -y \ libgl1-mesa-glx \ libglib2.0-0 \ ffmpeg \ libsndfile1 \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Install dependencies first for faster rebuilding COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy all your folders and files COPY . . # Ensure upload/temp folders exist and are writable RUN mkdir -p uploads resources static tts RUN chmod -R 777 uploads resources static tts EXPOSE 7860 # Point to main:app because your file is main.py CMD ["gunicorn", "--workers", "1", "--timeout", "300", "-b", "0.0.0.0:7860", "main:app"]