ChandimaPrabath commited on
Commit
03af398
·
verified ·
1 Parent(s): b84d489

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +17 -8
entrypoint.sh CHANGED
@@ -1,20 +1,29 @@
1
  #!/bin/bash
2
 
3
- # Set the OLLAMA_ROOT environment variable to a writable directory
4
  export OLLAMA_ROOT=/tmp/ollama
5
 
6
  # Start the Ollama server in the background
 
7
  ollama serve &
 
8
 
9
  # Wait for the server to be ready
10
- sleep 5
 
 
 
 
 
11
 
12
- # Pull the necessary models
13
- #ollama pull deepseek-r1:1.5b
 
14
  ollama pull gemma3:270m
15
- ollama pull granite-embedding
16
  ollama pull nomic-embed-text
17
- ollama pull gemma3:1b
18
 
19
- # Keep the container running
20
- tail -f /dev/null
 
 
 
 
1
  #!/bin/bash
2
 
3
+ # Set the OLLAMA_ROOT to a writable directory
4
  export OLLAMA_ROOT=/tmp/ollama
5
 
6
  # Start the Ollama server in the background
7
+ echo "Starting Ollama server..."
8
  ollama serve &
9
+ pid=$!
10
 
11
  # Wait for the server to be ready
12
+ echo "Waiting for server to start..."
13
+ while ! curl -s -o /dev/null http://127.0.0.1:11434; do
14
+ echo "Server not yet available, waiting..."
15
+ sleep 1
16
+ done
17
+ echo "Server is up and running."
18
 
19
+ # Pull the models
20
+ echo "Pulling models..."
21
+ ollama pull gemma3:1b
22
  ollama pull gemma3:270m
 
23
  ollama pull nomic-embed-text
 
24
 
25
+ echo "All models pulled."
26
+
27
+ # Wait for the server process to exit
28
+ # This brings the background process to the foreground
29
+ wait $pid