FROM python:3.11-slim ENV PYTHONUNBUFFERED=1 \ PIP_NO_CACHE_DIR=1 \ PYPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 \ HF_HOME=/tmp/hf \ MPLCONFIGDIR=/tmp/mpl RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential gfortran git curl && \ rm -rf /var/lib/apt/lists/* WORKDIR /app # CPU-only torch first (mace-torch pulls torch; avoid the huge CUDA wheels). RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu # Install ChemGraph (Lu Zhang's hardened Argonne-LCF fork) + calculators (TBLite) # + the API server. Full dependency set = matches the verified local environment. COPY pyproject.toml LICENSE config.toml ./ COPY src ./src RUN pip install --no-cache-dir ".[calculators]" && \ pip install --no-cache-dir fastapi "uvicorn[standard]" COPY cg_extract.py app.py ./ COPY precomputed ./precomputed ENV CHEMGRAPH_CONFIG=/app/config.toml EXPOSE 7860 CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]