# Base on Official Python 3.11 Slim FROM python:3.11-slim # Set environment variables ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 ENV STREAMLIT_SERVER_PORT 7860 ENV STREAMLIT_SERVER_ADDRESS 0.0.0.0 # Install system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ curl \ git \ libgl1 \ && rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /app # Copy requirements and install COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Install PyTorch CPU version RUN pip install --no-cache-dir torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1 --index-url https://download.pytorch.org/whl/cpu # Install PyTorch Geometric dependencies RUN pip install --no-cache-dir pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.7.0+cpu.html # Install PyTorch Geometric RUN pip install --no-cache-dir torch_geometric # Install spMetaTME package from GitHub RUN pip install --no-cache-dir git+https://github.com/SurajRepo/spMetaTME.git@multi_sample # Copy application code COPY . . # Expose port for Hugging Face Spaces EXPOSE 7860 # Healthcheck HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health # Run the app CMD ["streamlit", "run", "app.py"]