# Use an official Python runtime as a parent image FROM python:3.10-slim # Set environment variables ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 # Set work directory WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ libpq-dev \ && rm -rf /var/lib/apt/lists/* # Install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy project files COPY . . # Expose Hugging Face compatible port EXPOSE 7860 # Run the Flask app on 0.0.0.0:7860 (Hugging Face expects this) CMD ["python", "app.py"]