csepartha commited on
Commit
fa4c2a6
·
verified ·
1 Parent(s): c10a27a

Upload 2 files

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -2
  2. demo.launcher +11 -4
Dockerfile CHANGED
@@ -13,7 +13,7 @@ RUN pip install --no-cache-dir -r requirements.txt
13
  # Copy project files into the container
14
  COPY . ./
15
 
16
- # Make sure the demo.launcher script is executable
17
  RUN chmod +x demo.launcher
18
 
19
  # Add a non-root user and change ownership of necessary files
@@ -22,7 +22,7 @@ RUN useradd -ms /bin/bash user && chown -R user:user ./server.py ./client.py ./d
22
  # Switch to the non-root user
23
  USER user
24
 
25
- # Expose the port that Gradio will use
26
  EXPOSE 7860 8000
27
 
28
  # Start the demo.launcher script to run everything
 
13
  # Copy project files into the container
14
  COPY . ./
15
 
16
+ # Make the demo.launcher script executable
17
  RUN chmod +x demo.launcher
18
 
19
  # Add a non-root user and change ownership of necessary files
 
22
  # Switch to the non-root user
23
  USER user
24
 
25
+ # Expose the ports (Gradio on 7860, MCP on 8000)
26
  EXPOSE 7860 8000
27
 
28
  # Start the demo.launcher script to run everything
demo.launcher CHANGED
@@ -1,13 +1,20 @@
1
  #!/bin/bash
2
- # Pull your Ollama model (can be moved to build if desired)
 
 
3
  ollama pull granite3.1-moe
 
 
 
4
  ollama serve &
5
- sleep 5
6
 
7
  # Start MCP server in the background
 
8
  python3 server.py &
9
- sleep 5 # Ensure server is fully initialized
10
 
11
- # Start Gradio client
 
12
  python3 client.py --server_name 0.0.0.0 --server_port 7860
13
 
 
1
  #!/bin/bash
2
+
3
+ # Ensure that Ollama model is pulled
4
+ echo "Pulling Ollama model (granite3.1-moe)..."
5
  ollama pull granite3.1-moe
6
+
7
+ # Start the Ollama API server in the background
8
+ echo "Starting Ollama API server..."
9
  ollama serve &
10
+ sleep 15 # Increased wait time for Ollama to initialize
11
 
12
  # Start MCP server in the background
13
+ echo "Starting MCP server..."
14
  python3 server.py &
15
+ sleep 5 # Ensure the MCP server is fully initialized
16
 
17
+ # Start Gradio client (wait to ensure everything is ready)
18
+ echo "Starting Gradio client..."
19
  python3 client.py --server_name 0.0.0.0 --server_port 7860
20