FROM python:3.11-slim

WORKDIR /app

RUN pip install --no-cache-dir \
    "torch" --index-url https://download.pytorch.org/whl/cpu && \
    pip install --no-cache-dir \
    "chronos-forecasting" \
    fastapi \
    "uvicorn[standard]"

COPY app.py .

# HuggingFace model cache — volume-mounted so model persists across restarts
ENV HF_HOME=/root/.cache/huggingface

EXPOSE 8100

CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8100"]
