Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- 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
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|