# ── Space n°2 : Copilote d'analyse (5 bots + Qwen2.5-Coder-1.5B, 4 slots) ── # Base = image officielle llama.cpp "server" : le binaire /app/llama-server y est # livré AVEC ses bibliothèques partagées (libllama, libggml*, libgomp) et curl. # (L'ancienne version copiait le binaire seul dans python:3.11-slim → il plantait.) FROM ghcr.io/ggml-org/llama.cpp:server # L'image définit ENTRYPOINT ["/app/llama-server"] : on le neutralise. ENTRYPOINT [] # Plan B : binaires + bibliothèques de l'image :full (celle du BLUSTER d'origine, # qui démarrait). start.sh utilise le premier binaire dont tous les .so se résolvent. COPY --from=ghcr.io/ggml-org/llama.cpp:full /app/ /opt/llama-full/ RUN apt-get update && apt-get install -y --no-install-recommends \ python3 python3-venv ca-certificates curl procps \ && rm -rf /var/lib/apt/lists/* # venv : évite les conflits pip/apt (PEP 668) quelle que soit la version d'Ubuntu. RUN python3 -m venv /opt/venv ENV PATH="/opt/venv/bin:$PATH" PYTHONUNBUFFERED=1 COPY requirements.txt /srv/app/requirements.txt # --only-binary : jamais de compilation (pas de cc/rustc dans l image). RUN pip install --no-cache-dir --only-binary=:all: -r /srv/app/requirements.txt # Qwen2.5-Coder-1.5B-Instruct Q4_K_M (~1 Go) RUN curl -fL --retry 3 -o /model.gguf \ "https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF/resolve/main/qwen2.5-coder-1.5b-instruct-q4_k_m.gguf" \ && chmod 444 /model.gguf # Le code va dans /srv/app : on ne touche pas /app (binaire + libs llama.cpp). COPY . /srv/app WORKDIR /srv/app RUN chmod +x start.sh EXPOSE 7860 CMD ["bash", "start.sh"]