| FROM python:3.10-slim | |
| WORKDIR /app | |
| # Copy first so requirement changes always invalidate the layer | |
| COPY requirements.txt /app/requirements.txt | |
| RUN pip install --upgrade pip && pip install --no-cache-dir -r /app/requirements.txt | |
| # Now copy model and code | |
| COPY Random_Forest_pipeline_for_hf.joblib /app/model.joblib | |
| COPY app.py /app/ | |
| COPY main.py /app/ | |
| EXPOSE 7860 | |
| ENV PORT=7860 | |
| # Different CMD line also invalidates the cache | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |