FROM python:3.11-slim # Set working directory WORKDIR /app # Install only essential system dependencies RUN apt-get update && apt-get install -y \ wget \ curl \ git \ ffmpeg \ && rm -rf /var/lib/apt/lists/* # Copy only requirements first (cache layer) COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy all code COPY . . # Expose FastAPI port EXPOSE 7860 ENV PORT=7860 # Run app CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]