# Use Python 3.9 FROM python:3.9 # Set working directory WORKDIR /app # Copy requirements COPY requirements.txt . # 1. Install specific NumPy version FIRST to prevent conflicts RUN pip install "numpy<2.0.0" # 2. Install Torch 2.1.2 (Stable CPU version) RUN pip install torch==2.1.2 --index-url https://download.pytorch.org/whl/cpu # 3. Install PyTorch Geometric Dependencies (Matching Torch 2.1.2) RUN pip install torch-scatter torch-sparse torch-cluster torch-spline-conv -f https://data.pyg.org/whl/torch-2.1.2+cpu.html # 4. Install PyTorch Geometric RUN pip install torch-geometric # 5. Install the rest (FastAPI, scikit-learn, etc.) RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the app COPY . . # Fix permissions RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache # Expose port EXPOSE 7860 # Run CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]