alibidaran commited on
Commit
64a69fe
·
verified ·
1 Parent(s): f68862b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -5
Dockerfile CHANGED
@@ -5,15 +5,33 @@ FROM python:3.10-slim
5
  RUN apt-get update && apt-get install -y curl unzip && rm -rf /var/lib/apt/lists/*
6
 
7
  # Install Ollama server
8
- RUN curl -fsSL https://ollama.com/install.sh | sh
9
  # Set working directory for the app
10
  WORKDIR /app
11
 
12
  # Create a directory for Ollama
13
- RUN mkdir -p /app/.ollama
14
-
15
- # Set environment variable for Ollama home directory
16
- ENV OLLAMA_HOME=/app/.ollama
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  # Copy application files and model
19
  COPY . /app
 
5
  RUN apt-get update && apt-get install -y curl unzip && rm -rf /var/lib/apt/lists/*
6
 
7
  # Install Ollama server
 
8
  # Set working directory for the app
9
  WORKDIR /app
10
 
11
  # Create a directory for Ollama
12
+ RUN apt-get update && apt-get install -y \
13
+ curl \
14
+ build-essential \
15
+ libffi-dev \
16
+ cmake \
17
+ libcurl4-openssl-dev \
18
+ tini && \
19
+ apt-get clean
20
+
21
+ # Upgrade pip and install dependencies
22
+ RUN python -m venv venv && \
23
+ . /app/venv/bin/activate && \
24
+ pip install --upgrade pip && \
25
+ pip install --no-cache-dir -r requirements.txt
26
+
27
+ # Install Ollama
28
+ RUN curl https://ollama.ai/install.sh | sh
29
+
30
+ # Create the directory and give appropriate permissions
31
+ RUN mkdir -p /.ollama && chmod 777 /.ollama
32
+
33
+ # Ensure Ollama binary is in the PATH
34
+ ENV PATH="/app/venv/bin:/root/.ollama/bin:$PATH"
35
 
36
  # Copy application files and model
37
  COPY . /app