FROM python:3.11-slim AS base ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 WORKDIR /app # System deps for scientific/ML stack (pandas, numpy, pillow, reportlab, etc.) RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ gcc \ ffmpeg \ libjpeg-dev \ zlib1g-dev \ libpng-dev \ libfreetype6-dev \ && rm -rf /var/lib/apt/lists/* # Install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy source COPY . . # Sanity-check that a .env file is present before launching CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] EXPOSE 8000