# Use an official lightweight Python image FROM python:3.10-slim # Prevent Python from writing .pyc files and buffering stdout ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 # Create a working directory WORKDIR /app # Copy requirements first to leverage Docker layer caching COPY requirements.txt . # Install dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the app COPY . . # Expose port (HF Spaces typically use 7860 for Gradio/Streamlit) EXPOSE 7860 # Command to run the app CMD ["python", "app.py"]