# Use official lightweight Python image FROM python:3.9-slim # Set environment variables ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 WORKDIR /app # Install system build dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ && rm -rf /var/lib/apt/lists/* # Copy requirements and install COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the application COPY . . # Expose Hugging Face Space port ENV PORT=7860 EXPOSE 7860 # Run database seeder first, then start Gunicorn WSGI server CMD python3 seed.py && gunicorn --bind 0.0.0.0:7860 app:app