# Alignement strict sur CUDA 12.2 pour piloter l'architecture de la NVIDIA L4 FROM nvidia/cuda:12.2.2-runtime-ubuntu22.04 # Variables d'environnement pour figer la non-interactivité et les chemins ENV PYTHONUNBUFFERED=1 ENV TMPDIR=/tmp ENV DEBIAN_FRONTEND=noninteractive # --- CONFIGURATION STRICTE POUR NVIDIA L4 (ADA LOVELACE COMPUTE 8.9) --- ENV OLLAMA_CUDA_COMPUTE_CAPABILITIES="89" ENV TORCH_CUDA_ARCH_LIST="8.9" ENV FORCE_CUDA=1 # Installation des outils système indispensables RUN apt-get update && apt-get install -y --no-install-recommends \ python3 \ python3-pip \ python3-dev \ python3-venv \ build-essential \ curl \ git \ zstd \ && rm -rf /var/lib/apt/lists/* # Fixation de la couche d'outils de build Python globaux RUN pip3 install --no-cache-dir --upgrade pip setuptools wheel # Intégration d'Ollama - Les variables du dessus vont forcer le téléchargement du binaire Compute 8.9 RUN curl -fsSL https://ollama.com/install.sh | sh # Définition du workspace WORKDIR /app # Isolation du requirements pour maximiser le cache COPY executives/requirements.txt . # --- COUCHES DE SÉQUENÇAGE STATIQUE (INSTALLATION DES PACKAGES) --- RUN pip3 install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 RUN pip3 install --no-cache-dir -r requirements.txt RUN pip3 install --no-cache-dir scikit-learn==1.5.2 joblib==1.4.2 numpy==1.26.4 --force-reinstall # Copie finale du code applicatif COPY . /app # Attribution des droits sur le script de démarrage interne RUN chmod +x /app/start.sh # Nettoyage des entrypoints ENTRYPOINT [] # Exposition des ports Gradio (UI) et Ollama (Inférence) EXPOSE 7860 11434 # Allumage du pipeline CMD ["/app/start.sh"]