FROM python:3.12.12 AS builder ENV PYTHONUNBUFFERED=1 \ PYTHONDONTWRITEBYTECODE=1 WORKDIR /app RUN python -m venv .venv COPY requirements.txt ./ RUN .venv/bin/pip install -r requirements.txt FROM python:3.12.12-slim WORKDIR /app # Native libs required by xgboost / scikit-learn wheels RUN apt-get update \ && apt-get install -y --no-install-recommends libgomp1 libopenblas0-pthread \ && rm -rf /var/lib/apt/lists/* COPY --from=builder /app/.venv .venv/ COPY . . CMD ["/app/.venv/bin/uvicorn", "api.app:app", "--host", "0.0.0.0", "--port", "7860"]