# fxhnt cockpit + pipeline image. One image serves the dashboard (fxhnt serve) and runs the daily
# fetch+track+ingest CronJob. Build context = the fxhnt repo root.
FROM python:3.11-slim AS base
ENV PYTHONUNBUFFERED=1 PIP_NO_CACHE_DIR=1
WORKDIR /app
COPY pyproject.toml README.md ./
COPY src/ ./src/
# The `poc` extra pulls torch (faithful surfer-PoC port requirement). Use the PyTorch CPU index so the
# cockpit pod gets the small CPU wheel, not the multi-GB CUDA build (no GPU here). NOTE (deploy): the surfer
# PoC paper track also needs the crypto PIT cache at $FXHNT_SURFER_DATA_DIR/crypto_pit/*.npz — already present
# in the pod for the combined book; no extra mount needed.
RUN pip install --upgrade pip && \
    pip install --extra-index-url https://download.pytorch.org/whl/cpu \
        '.[web,pg,data,factory,orchestration,poc]'
# DSN is injected at runtime via secretKeyRef in the K8s manifests; empty here so the image contains no credentials.
ENV FXHNT_OPERATIONAL_DSN=""
EXPOSE 8080
CMD ["fxhnt", "serve", "--host", "0.0.0.0", "--port", "8080"]
