ЯRаСлав commited on
Commit
1d95250
·
1 Parent(s): efc1b48

Docker config update.

Browse files
Files changed (3) hide show
  1. Dockerfile +18 -7
  2. docker-compose.yml +4 -2
  3. start.sh +6 -12
Dockerfile CHANGED
@@ -1,13 +1,24 @@
1
  FROM ghcr.io/open-webui/open-webui:ollama
2
 
3
- # Expose the port
4
- EXPOSE 8080
 
5
 
6
- # Keep the existing volumes but adapt for Hugging Face Spaces
 
 
7
  RUN mkdir -p /data/ollama && \
8
  mkdir -p /data/webui && \
9
- ln -s /data/ollama /root/.ollama && \
10
- ln -s /data/webui /app/backend/data
 
 
 
 
 
 
 
 
11
 
12
- # Start command (same as original)
13
- CMD ["bash", "-c", "ollama serve & /start.sh"]
 
1
  FROM ghcr.io/open-webui/open-webui:ollama
2
 
3
+ # Set up proper paths for Hugging Face
4
+ ENV OLLAMA_HOST=0.0.0.0
5
+ WORKDIR /app
6
 
7
+ EXPOSE 7860
8
+
9
+ # Create symbolic links for persistent storage
10
  RUN mkdir -p /data/ollama && \
11
  mkdir -p /data/webui && \
12
+ ln -sf /data/ollama /root/.ollama && \
13
+ ln -sf /data/webui /app/backend/data
14
+
15
+ # Copy custom start script
16
+ COPY start.sh /app/start.sh
17
+ RUN chmod +x /app/start.sh
18
+
19
+ # Health check
20
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
21
+ CMD curl -f http://localhost:8080 || exit 1
22
 
23
+ # Run the start script
24
+ CMD ["/bin/bash", "/app/start.sh"]
docker-compose.yml CHANGED
@@ -4,11 +4,13 @@ services:
4
  webui:
5
  build: .
6
  ports:
7
- - "8080:8080"
8
  volumes:
9
  - ollama_data:/data/ollama
10
  - webui_data:/data/webui
11
- restart: always
 
 
12
 
13
  volumes:
14
  ollama_data:
 
4
  webui:
5
  build: .
6
  ports:
7
+ - "7860:7860" # Hugging Face requires external:internal port to match
8
  volumes:
9
  - ollama_data:/data/ollama
10
  - webui_data:/data/webui
11
+ environment:
12
+ - WEBUI_PORT=7860
13
+ restart: unless-stopped
14
 
15
  volumes:
16
  ollama_data:
start.sh CHANGED
@@ -1,15 +1,9 @@
1
  #!/bin/bash
2
 
3
- echo "[start.sh] Starting MongoDB..." 😎
4
- mkdir -p /data/db
5
- find /data/db -name "*.lock" -type f -exec rm -f {} \;
6
- mongod &
7
 
8
- echo "[start.sh] Starting text-generation-inference..." 🚀
9
- text-generation-launcher --model-id ${MODEL_NAME} --num-shard 1 --port 8080 --trust-remote-code &
10
-
11
- echo "[start.sh] Waiting for model to become healthy..." ⏳
12
- curl --retry 60 --retry-delay 10 --retry-connrefused http://127.0.0.1:8080/health
13
-
14
- echo "[start.sh] Launching WebUI..." 🌐
15
- dotenv -e /app/.env -c -- node /app/build/index.js -- --host 0.0.0.0 --port 3000
 
1
  #!/bin/bash
2
 
3
+ # Start Ollama in background
4
+ echo "Starting Ollama..."
5
+ ollama serve &
 
6
 
7
+ # Start Open WebUI (correct path based on official image)
8
+ echo "Starting Open WebUI..."
9
+ exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf