FROM python:3.11-slim WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ whois \ && rm -rf /var/lib/apt/lists/* COPY requirements.txt . # Upgrade pip and install core deployment components RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir gunicorn flask flask-cors joblib # Install scikit-learn 1.8.0 directly to match your local export environment RUN pip install --no-cache-dir scikit-learn==1.8.0 # Install the rest of your requirements RUN pip install --no-cache-dir -r requirements.txt COPY . . ENV PORT=7860 EXPOSE 7860 CMD ["gunicorn", "app:app", "--workers", "1", "--timeout", "120", "--bind", "0.0.0.0:7860"]