# Use a lightweight Python base image FROM python:3.11-slim # Set working directory WORKDIR /app # Copy requirements file first (for efficient Docker caching) COPY requirements.txt . # Install dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the application files COPY . . # Expose port 7860 (Hugging Face default) EXPOSE 7860 # Set environment variables ENV PYTHONUNBUFFERED=1 # Run the Flask app on 0.0.0.0:7860 (required by HF) CMD ["python", "app.py"]