# quantcore -- portfolio quant service for the DGX Spark (aarch64) and any x86-64 host. # Build context is the repository root: docker build -f deploy/Dockerfile -t local/quantcore:0.1 . FROM python:3.12-slim ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 PIP_NO_CACHE_DIR=1 \ QUANTCORE_DATA_DIR=/data QUANTCORE_CUOPT_URL=http://cuopt:5000 \ OPENBLAS_NUM_THREADS=4 OMP_NUM_THREADS=4 MKL_NUM_THREADS=4 # BLAS threading: the innovation filter runs thousands of small (N x N) eigendecompositions; # OpenBLAS with all 20 cores of the Spark is ~50x slower on those than with 1-4 threads. RUN apt-get update && apt-get install -y --no-install-recommends curl tini \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY pyproject.toml README.md ./ COPY quantcore ./quantcore RUN pip install . VOLUME ["/data"] EXPOSE 5001 HEALTHCHECK --interval=60s --timeout=10s --retries=2 CMD curl -sf http://localhost:5001/health >/dev/null || exit 1 ENTRYPOINT ["/usr/bin/tini", "--"] CMD ["uvicorn", "quantcore.api.app:app", "--host", "0.0.0.0", "--port", "5001", "--workers", "1"]