Techbitforge commited on
Commit
7d0cef6
·
verified ·
1 Parent(s): c86dec6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -6
Dockerfile CHANGED
@@ -3,17 +3,32 @@ FROM ghcr.io/open-webui/open-webui:main
3
 
4
  # 2. Environment Variables
5
  ENV PORT=7860
6
- ENV OLLAMA_BASE_URL=http://localhost:11434
7
- ENV OLLAMA_MODELS=/app/backend/data/ollama
8
 
9
  # 3. Switch to root
10
  USER root
11
 
12
- # 4. FIX: Install 'zstd' which is required for Ollama installation
13
- RUN apt-get update && apt-get install -y zstd
14
 
15
  # 5. Install Ollama
16
  RUN curl -fsSL https://ollama.com/install.sh | sh
17
 
18
- # 6. Start Ollama (background) -> Wait -> Start WebUI
19
- CMD bash -c "ollama serve & sleep 10 && /app/backend/start.sh"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  # 2. Environment Variables
5
  ENV PORT=7860
6
+ ENV OLLAMA_BASE_URL=http://127.0.0.1:11434
 
7
 
8
  # 3. Switch to root
9
  USER root
10
 
11
+ # 4. Install dependencies
12
+ RUN apt-get update && apt-get install -y zstd curl
13
 
14
  # 5. Install Ollama
15
  RUN curl -fsSL https://ollama.com/install.sh | sh
16
 
17
+ # 6. Create startup script
18
+ RUN echo '#!/bin/bash\n\
19
+ set -e\n\
20
+ \n\
21
+ echo "Starting Ollama..."\n\
22
+ ollama serve &\n\
23
+ \n\
24
+ echo "Waiting for Ollama to be ready..."\n\
25
+ until curl -s http://127.0.0.1:11434 > /dev/null; do\n\
26
+ sleep 2\n\
27
+ done\n\
28
+ \n\
29
+ echo "Ollama is ready. Starting Open WebUI..."\n\
30
+ exec /app/backend/start.sh\n\
31
+ ' > /start.sh && chmod +x /start.sh
32
+
33
+ # 7. Run
34
+ CMD ["/start.sh"]