# Use official Python 3.11 slim image FROM python:3.11-slim # Set working directory WORKDIR /app # Prevent Python from writing .pyc files and buffering stdout/stderr ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ curl \ git \ && rm -rf /var/lib/apt/lists/* # Copy requirements file COPY requirements.txt . # Install Python dependencies RUN pip install --upgrade pip RUN pip install --no-cache-dir -r requirements.txt # Copy the entire app code COPY . . # Expose the port Gradio will run on (Hugging Face Spaces uses 7860 by default) EXPOSE 7860 # Default command to run the Gradio app CMD ["python", "app.py"]