klentyboopathi commited on
Commit
2df52da
·
1 Parent(s): abde073
Files changed (1) hide show
  1. Dockerfile +8 -11
Dockerfile CHANGED
@@ -1,26 +1,23 @@
1
  FROM python:3.11-slim
2
  WORKDIR /app
3
 
4
- # Install wget
5
- RUN apt update && apt install -y wget && apt install -y curl
6
 
7
- # Install Python dependencies
8
  COPY requirements.txt .
9
  RUN pip install --no-cache-dir -r requirements.txt && \
10
- which uvicorn && \
11
- uvicorn --version
12
 
13
- # Copy the backend code
14
  COPY . .
15
-
16
  RUN chmod +x ./setup.sh && ./setup.sh
17
 
18
- EXPOSE 7860
19
-
20
- # Create a user-writable directory for Ollama
21
  ENV OLLAMA_MODELS=/app/.ollama
22
  RUN mkdir -p /app/.ollama
23
 
24
- # CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]
25
 
26
  CMD bash -c "ollama serve & sleep 5 && ollama pull smollm && uvicorn server:app --host 0.0.0.0 --port 7860"
 
1
  FROM python:3.11-slim
2
  WORKDIR /app
3
 
4
+ # Install dependencies
5
+ RUN apt update && apt install -y wget curl
6
 
7
+ # Python dependencies
8
  COPY requirements.txt .
9
  RUN pip install --no-cache-dir -r requirements.txt && \
10
+ which uvicorn && uvicorn --version
 
11
 
12
+ # Copy code and setup
13
  COPY . .
 
14
  RUN chmod +x ./setup.sh && ./setup.sh
15
 
16
+ # Set Ollama storage directory correctly
17
+ ENV HOME=/app
 
18
  ENV OLLAMA_MODELS=/app/.ollama
19
  RUN mkdir -p /app/.ollama
20
 
21
+ EXPOSE 7860
22
 
23
  CMD bash -c "ollama serve & sleep 5 && ollama pull smollm && uvicorn server:app --host 0.0.0.0 --port 7860"