Actualiser dockerfile.txt

This commit is contained in:
2026-02-23 16:29:53 +00:00
parent 7a2a6faeb4
commit 5d2a3052cf

View File

@ -1,19 +1,18 @@
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. Système : Correction des noms de paquets pour Ubuntu Noble # 1. Système : Dépendances Ubuntu Noble (libgl1 et zstd inclus)
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
openssh-server ffmpeg libsndfile1 sox git curl zstd \ openssh-server ffmpeg libsndfile1 sox git curl zstd \
libgl1 libglib2.0-0 \ libgl1 libglib2.0-0 \
&& apt-get clean && rm -rf /var/lib/apt/lists/* && apt-get clean && rm -rf /var/lib/apt/lists/*
# Config SSH pour root # Config SSH pour root (Vast.ai)
RUN mkdir /var/run/sshd && \ RUN mkdir /var/run/sshd && \
echo 'root:root' | chpasswd && \ echo 'root:root' | chpasswd && \
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# 2. Python & Dépendances # 2. Python & Dépendances
# On installe numpy en premier pour verrouiller la version
RUN pip install --no-cache-dir numpy==1.26.4 RUN pip install --no-cache-dir numpy==1.26.4
RUN pip install --no-cache-dir \ RUN pip install --no-cache-dir \
open-webui gradio scipy soundfile julius omegaconf hydra-core \ open-webui gradio scipy soundfile julius omegaconf hydra-core \
@ -27,19 +26,20 @@ WORKDIR /root
RUN git clone https://github.com/comfyanonymous/ComfyUI.git && \ RUN git clone https://github.com/comfyanonymous/ComfyUI.git && \
cd ComfyUI && pip install --no-cache-dir -r requirements.txt cd ComfyUI && pip install --no-cache-dir -r requirements.txt
# 4. Copie du code # 4. Copie du code applicatif
RUN mkdir -p /root/audiocraft-api RUN mkdir -p /root/audiocraft-api
COPY server.py /root/audiocraft-api/server.py COPY server.py /root/audiocraft-api/server.py
# 5. Script de démarrage # 5. Script de démarrage : Correction critique de la syntaxe d'écriture
RUN echo '#!/bin/bash\n\ # Utilisation de printf avec doubles backslashes pour garantir les retours à la ligne réels
RUN printf "#!/bin/bash\n\
service ssh start\n\ service ssh start\n\
ollama serve > /root/ollama.log 2>&1 & \n\ ollama serve > /root/ollama.log 2>&1 & \n\
open-webui serve --port 3000 > /root/webui.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/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\ python3 /root/audiocraft-api/server.py > /root/audio.log 2>&1 & \n\
echo "Studio Ready" \n\ echo 'Studio Ready' \n\
sleep infinity' > /start.sh && chmod +x /start.sh sleep infinity" > /start.sh && chmod +x /start.sh
EXPOSE 22 3000 7860 8188 11434 EXPOSE 22 3000 7860 8188 11434
ENTRYPOINT ["/bin/bash", "/start.sh"] ENTRYPOINT ["/bin/bash", "/start.sh"]