# Use a slim Python image FROM python:3.11-slim # Set working directory WORKDIR /app # Install system dependencies (needed for some python libs) RUN apt-get update && apt-get install -y \ build-essential \ && rm -rf /var/lib/apt/lists/* # Copy requirements first for better caching COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of your application and resources COPY . . # Expose the port Hugging Face uses EXPOSE 7860 # Run the server using the SSE transport # We point to port 7860 as required by HF CMD ["python", "server.py", "--transport", "sse", "--port", "7860"]