FROM python:3.10-slim WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ libgomp1 \ git \ && rm -rf /var/lib/apt/lists/* # Install CPU-only PyTorch (from special index) RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu # Install orb-models (required for ORBFeaturizer) RUN pip install --no-cache-dir orb-models # Install MatterVial and its dependencies RUN pip install --no-cache-dir \ "mattervial @ git+https://github.com/rogeriog/MatterVial.git" \ pymatgen \ scikit-learn \ pandas \ fastapi \ uvicorn \ python-multipart COPY . . # HF Spaces requires port 7860 EXPOSE 7860 # Launch with generous timeout for model loading CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--timeout-keep-alive", "120"]