MB-IDK commited on
Commit
97ff133
·
verified ·
1 Parent(s): de3f42e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -9
Dockerfile CHANGED
@@ -1,22 +1,27 @@
1
- # On utilise l'image d'Open WebUI comme base (elle est plus lourde à installer)
2
  FROM ghcr.io/open-webui/open-webui:main
3
 
4
- # Installation d'Ollama à l'intérieur de l'image
 
 
 
 
5
  RUN curl -fsSL https://ollama.com/install.sh | sh
6
 
7
- # Configurer les variables d'environnement pour Hugging Face
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
- # Créer un script de démarrage pour lancer les deux services en même temps
13
  RUN echo '#!/bin/bash\n\
14
  ollama serve &\n\
15
- sleep 5\n\
16
- ollama run llama3.2:1b "hello" &\n\
17
- # Lancer Open WebUI sur le port 7860\n\
 
18
  exec python3 -m open_webui serve --port 7860\n\
19
  ' > /start.sh && chmod +x /start.sh
20
 
21
- # Lancer le script au démarrage
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"]