Actualiser dockerfile.txt

This commit is contained in:
2026-02-23 14:20:51 +00:00
parent 624b5a150b
commit d5498781c6

View File

@ -1,60 +1,42 @@
FROM nvcr.io/nvidia/pytorch:26.01-py3 FROM nvcr.io/nvidia/pytorch:26.01-py3
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
# 1. Dépendances système et audio # 1. Système + SSH (La survie)
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
ffmpeg pkg-config libavcodec-dev libavformat-dev \ openssh-server ffmpeg libsndfile1 sox git curl \
libavutil-dev libswscale-dev libavdevice-dev libavfilter-dev \ && apt-get clean && rm -rf /var/lib/apt/lists/*
libsndfile1 sox zstd screen nano git wget curl \
&& apt-get clean && rm -rf /var/lib/apt/lists/* # Config SSH pour root (nécessaire pour Vast.ai)
RUN mkdir /var/run/sshd && \
# 2. Installation d'Ollama echo 'root:root' | chpasswd && \
RUN curl -fsSL https://ollama.ai/install.sh | sh sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# 3. Installation des dépendances Python (Validées par nos tests manuels) # 2. Python & Dépendances
# On installe les briques manquantes AVANT Audiocraft RUN pip install --no-cache-dir \
RUN pip install --no-cache-dir \ open-webui gradio scipy soundfile julius omegaconf hydra-core \
open-webui \ flashy torchmetrics encodec xformers einops spacy==3.7.6 numpy==1.26.4
gradio \
scipy \ RUN pip install --no-cache-dir --no-deps git+https://github.com/facebookresearch/audiocraft.git
soundfile \
julius \ # 3. Ollama & Comfy
omegaconf \ RUN curl -fsSL https://ollama.ai/install.sh | sh
hydra-core \ WORKDIR /root
hydra-colorlog \ RUN git clone https://github.com/comfyanonymous/ComfyUI.git && \
flashy \ cd ComfyUI && pip install --no-cache-dir -r requirements.txt
num2words \
torchmetrics \ # 4. Copie du code
encodec \ RUN mkdir -p /root/audiocraft-api
xformers \ COPY server.py /root/audiocraft-api/server.py
einops \
spacy==3.7.6 \ # 5. Nouveau script de démarrage Robuste
numpy==1.26.4 RUN echo '#!/bin/bash\n\
service ssh start\n\
# 4. Installation d'Audiocraft (Isolée pour ne pas casser PyTorch) ollama serve > /root/ollama.log 2>&1 & \n\
RUN pip install --no-cache-dir --no-deps git+https://github.com/facebookresearch/audiocraft.git open-webui serve --port 3000 > /root/webui.log 2>&1 & \n\
python3 /root/ComfyUI/main.py --listen 0.0.0.0 --port 8188 > /root/comfy.log 2>&1 & \n\
# 5. Installation ComfyUI python3 /root/audiocraft-api/server.py > /root/audio.log 2>&1 & \n\
WORKDIR /root echo "Studio Ready" \n\
RUN git clone https://github.com/comfyanonymous/ComfyUI.git && \ sleep infinity' > /start.sh && chmod +x /start.sh
cd ComfyUI && \
pip install --no-cache-dir -r requirements.txt EXPOSE 22 3000 7860 8188 11434
# 6. Intégration de ton script de serveur Audio
RUN mkdir -p /root/audiocraft-api
COPY server.py /root/audiocraft-api/server.py
# 7. Script d'auto-lancement (Auto-Boot) ultra-robuste
RUN echo '#!/bin/bash\n\
ollama serve > /root/ollama.log 2>&1 & \n\
open-webui serve --port 3000 > /root/webui.log 2>&1 & \n\
python3 /root/ComfyUI/main.py --listen 0.0.0.0 --port 8188 > /root/comfy.log 2>&1 & \n\
python3 /root/audiocraft-api/server.py > /root/audio.log 2>&1 & \n\
echo "--- TOUS LES SERVICES SONT EN COURS DE LANCEMENT ---"\n\
wait' > /start.sh && chmod +x /start.sh
# 8. Configuration finale
EXPOSE 3000 7860 8188 11434
WORKDIR /root
# On force l'utilisation de bash pour éviter les problèmes de droits
ENTRYPOINT ["/bin/bash", "/start.sh"] ENTRYPOINT ["/bin/bash", "/start.sh"]