thangquang09 commited on
Commit
72f49d5
·
1 Parent(s): 09a8622

update Dockerfile

Browse files
Files changed (3) hide show
  1. Dockerfile +3 -2
  2. pull_models.sh// +9 -0
  3. start.sh +3 -0
Dockerfile CHANGED
@@ -8,11 +8,12 @@ RUN pip install --no-cache-dir --upgrade -r /requirements.txt
8
 
9
  RUN curl -fsSL https://ollama.com/install.sh | sh
10
 
11
- RUN ollama pull phi2
12
-
13
  COPY start.sh /start.sh
14
  RUN chmod +x /start.sh
15
 
 
 
 
16
  EXPOSE 7860
17
 
18
  CMD ["/start.sh"]
 
8
 
9
  RUN curl -fsSL https://ollama.com/install.sh | sh
10
 
 
 
11
  COPY start.sh /start.sh
12
  RUN chmod +x /start.sh
13
 
14
+ COPY pull_models.sh /pull_models.sh
15
+ RUN chmod +x /pull_models.sh
16
+
17
  EXPOSE 7860
18
 
19
  CMD ["/start.sh"]
pull_models.sh// ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Kiểm tra xem model đã được tải chưa
4
+ if [ ! -d "/root/.ollama/models/manifests/phi2" ]; then
5
+ echo "Pulling phi2 model..."
6
+ ollama pull phi2
7
+ else
8
+ echo "phi2 model already exists"
9
+ fi
start.sh CHANGED
@@ -6,5 +6,8 @@ ollama serve &
6
  # Wait for Ollama to start
7
  sleep 5
8
 
 
 
 
9
  # Start FastAPI app
10
  uvicorn app:app --host 0.0.0.0 --port 7860
 
6
  # Wait for Ollama to start
7
  sleep 5
8
 
9
+ # Pull models if needed
10
+ /pull_models.sh
11
+
12
  # Start FastAPI app
13
  uvicorn app:app --host 0.0.0.0 --port 7860