# ── Build stage ─────────────────────────────────────────────────────────────── FROM python:3.11-slim # System deps RUN apt-get update && apt-get install -y --no-install-recommends \ git \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Clone Kronos source at build time (avoids runtime clone delay) RUN git clone --depth 1 https://github.com/shiyu-coder/Kronos /app/Kronos # Install Python deps first (layer cache friendly) COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application source COPY app.py predictor.py data_fetcher.py ./ # HuggingFace Spaces default port EXPOSE 7860 # KRONOS_DIR tells predictor.py where the source lives (already cloned above) ENV KRONOS_DIR=/app/Kronos CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]