redfernstech commited on
Commit
8429402
·
verified ·
1 Parent(s): ead3a98

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -1
Dockerfile CHANGED
@@ -3,6 +3,9 @@ FROM python:3.12.5
3
  # Install Ollama as root
4
  RUN curl -fsSL https://ollama.com/install.sh | sh
5
 
 
 
 
6
  # Create a new user and switch to it
7
  RUN useradd -m -u 1000 user
8
  USER user
@@ -22,4 +25,4 @@ COPY --chown=user . /app
22
  EXPOSE 7860
23
 
24
  # Start Ollama and FastAPI together
25
- CMD ["sh", "-c", "ollama serve & ollama pull llama3:8b && uvicorn app:app --host 0.0.0.0 --port 7860"]
 
3
  # Install Ollama as root
4
  RUN curl -fsSL https://ollama.com/install.sh | sh
5
 
6
+ # Start Ollama in the background and pull the model
7
+ RUN ollama serve & sleep 5 && ollama pull llama3:8b
8
+
9
  # Create a new user and switch to it
10
  RUN useradd -m -u 1000 user
11
  USER user
 
25
  EXPOSE 7860
26
 
27
  # Start Ollama and FastAPI together
28
+ CMD ["sh", "-c", "uvicorn app:app --host 0.0.0.0 --port 7860"]