# Use a lightweight Python image FROM python:3.10-slim # Set environment variables ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 # Install required system packages RUN apt-get update && apt-get install -y \ ffmpeg \ curl \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /app # Copy project files COPY . /app # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Expose port (Hugging Face usually maps this internally) EXPOSE 7860 # Start Flask app CMD ["python", "app.py"]