Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +7 -7
Dockerfile
CHANGED
@@ -1,8 +1,13 @@
|
|
1 |
# Use the official Python image from the Docker Hub
|
2 |
FROM python:3.9
|
3 |
|
4 |
-
# Install curl
|
5 |
-
RUN apt-get update && apt-get install -y curl
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
# Create a new user with a home directory and set the user ID
|
8 |
RUN useradd -m -u 1000 user
|
@@ -23,10 +28,5 @@ RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
|
23 |
# Copy the rest of the application code to the /app directory
|
24 |
COPY --chown=user . /app
|
25 |
|
26 |
-
# Install Ollama
|
27 |
-
RUN curl -fsSL https://ollama.com/install.sh | sh
|
28 |
-
|
29 |
-
RUN ollama pull mistral
|
30 |
-
RUN ollama pull nomic-embed-text
|
31 |
# Set the command to run the application
|
32 |
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
# Use the official Python image from the Docker Hub
|
2 |
FROM python:3.9
|
3 |
|
4 |
+
# Install curl and Ollama as root
|
5 |
+
RUN apt-get update && apt-get install -y curl \
|
6 |
+
&& curl -fsSL https://ollama.com/install.sh | sh \
|
7 |
+
&& rm -rf /var/lib/apt/lists/*
|
8 |
+
|
9 |
+
# Pull the necessary models using Ollama
|
10 |
+
RUN ollama pull mistral && ollama pull nomic-embed-text
|
11 |
|
12 |
# Create a new user with a home directory and set the user ID
|
13 |
RUN useradd -m -u 1000 user
|
|
|
28 |
# Copy the rest of the application code to the /app directory
|
29 |
COPY --chown=user . /app
|
30 |
|
|
|
|
|
|
|
|
|
|
|
31 |
# Set the command to run the application
|
32 |
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]
|