redfernstech commited on
Commit
7f20f11
·
verified ·
1 Parent(s): 1498adf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -12
Dockerfile CHANGED
@@ -2,24 +2,17 @@ FROM python:3.11-slim as base
2
 
3
  WORKDIR /app
4
 
5
- # Install system tools including curl and pkill (from procps package)
6
- RUN apt-get update && apt-get install -y curl procps && rm -rf /var/lib/apt/lists/*
7
 
8
  # Install Ollama
9
  RUN curl -fsSL https://ollama.com/install.sh | bash
10
  ENV PATH="/root/.ollama/bin:$PATH"
11
 
12
- # Start Ollama to pull model, then stop it
13
- RUN ollama serve & sleep 5 && ollama pull mannix/defog-llama3-sqlcoder-8b:latest && echo "Done. Stop Ollama..." && pkill ollama
14
-
15
- # Install Python dependencies
16
- COPY requirements.txt .
17
  RUN pip install --no-cache-dir -r requirements.txt
18
-
19
- # Copy app source code
20
  COPY . .
21
 
22
  EXPOSE 8000
23
-
24
- # Start Ollama and FastAPI app
25
- CMD ["sh", "-c", "ollama serve & uvicorn app.main:app --host 0.0.0.0 --port 8000"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install system tools
6
+ RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
7
 
8
  # Install Ollama
9
  RUN curl -fsSL https://ollama.com/install.sh | bash
10
  ENV PATH="/root/.ollama/bin:$PATH"
11
 
12
+ RUN ollama serve & sleep 5 && ollama pull mannix/defog-llama3-sqlcoder-8b:latest && echo "Done. Stop Ollama..." && systemctl stop ollama
13
+ COPY requirements.txt ./
 
 
 
14
  RUN pip install --no-cache-dir -r requirements.txt
 
 
15
  COPY . .
16
 
17
  EXPOSE 8000
18
+ CMD ["sh", "-c", "ollama serve & uvicorn app.main:app --host 0.0.0.0 --port 8000"]