Update Dockerfile
Browse files- Dockerfile +14 -9
Dockerfile
CHANGED
|
@@ -1,22 +1,27 @@
|
|
| 1 |
-
#
|
| 2 |
FROM ghcr.io/open-webui/open-webui:main
|
| 3 |
|
| 4 |
-
# Installation
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
RUN curl -fsSL https://ollama.com/install.sh | sh
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
# Le port par défaut de HF est 7860
|
| 9 |
ENV OLLAMA_BASE_URL=http://127.0.0.1:11434
|
| 10 |
ENV PORT=7860
|
|
|
|
| 11 |
|
| 12 |
-
#
|
| 13 |
RUN echo '#!/bin/bash\n\
|
| 14 |
ollama serve &\n\
|
| 15 |
-
sleep
|
| 16 |
-
|
| 17 |
-
|
|
|
|
| 18 |
exec python3 -m open_webui serve --port 7860\n\
|
| 19 |
' > /start.sh && chmod +x /start.sh
|
| 20 |
|
| 21 |
-
# Lancer le script
|
| 22 |
CMD ["/start.sh"]
|
|
|
|
| 1 |
+
# Utilisation de l'image Open WebUI comme base
|
| 2 |
FROM ghcr.io/open-webui/open-webui:main
|
| 3 |
|
| 4 |
+
# Installation de zstd (nécessaire pour Ollama) et des certificats
|
| 5 |
+
USER root
|
| 6 |
+
RUN apt-get update && apt-get install -y zstd ca-certificates && rm -rf /var/lib/apt/lists/*
|
| 7 |
+
|
| 8 |
+
# Installation d'Ollama
|
| 9 |
RUN curl -fsSL https://ollama.com/install.sh | sh
|
| 10 |
|
| 11 |
+
# Configuration des variables d'environnement pour Hugging Face
|
|
|
|
| 12 |
ENV OLLAMA_BASE_URL=http://127.0.0.1:11434
|
| 13 |
ENV PORT=7860
|
| 14 |
+
ENV HOME=/tmp
|
| 15 |
|
| 16 |
+
# Création du script de démarrage
|
| 17 |
RUN echo '#!/bin/bash\n\
|
| 18 |
ollama serve &\n\
|
| 19 |
+
sleep 10\n\
|
| 20 |
+
# On télécharge un modèle très léger adapté aux 2 vCPUs\n\
|
| 21 |
+
ollama run llama3.2:1b "Hello" &\n\
|
| 22 |
+
# Lancer Open WebUI sur le port imposé par HF\n\
|
| 23 |
exec python3 -m open_webui serve --port 7860\n\
|
| 24 |
' > /start.sh && chmod +x /start.sh
|
| 25 |
|
| 26 |
+
# Lancer le script
|
| 27 |
CMD ["/start.sh"]
|