File size: 1,755 Bytes
dfcacaf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# 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"]