FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04 # Install Python 3.11 and system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ python3.11 \ python3.11-dev \ python3-pip \ libgl1 \ libglib2.0-0 \ libsm6 \ libxext6 \ libxrender-dev \ libgomp1 \ && update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1 \ && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY requirements.txt . # Install PyTorch with CUDA 12.4 support, then the rest RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cu124 && \ pip install --no-cache-dir -r requirements.txt COPY . . # Hugging Face model cache (overridable via HF_HOME env var) ENV HF_HOME=/app/cache ENV JUPYTER_TOKEN=grapholab EXPOSE 7860 8888 COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"]