Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +20 -8
Dockerfile
CHANGED
@@ -1,21 +1,33 @@
|
|
|
|
1 |
FROM ollama/ollama:latest
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
|
|
|
10 |
ENV HOME=/home/user \
|
11 |
-
|
12 |
OLLAMA_HOST=0.0.0.0 \
|
13 |
OLLAMA_ORIGINS=*
|
14 |
|
|
|
15 |
WORKDIR $HOME/app
|
|
|
16 |
|
|
|
17 |
COPY --chown=user:user Modelfile $HOME/app/
|
18 |
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
|
|
21 |
EXPOSE 11434
|
|
|
1 |
+
# Use the latest version of the ollama image
|
2 |
FROM ollama/ollama:latest
|
3 |
|
4 |
+
# Install curl and create a user
|
5 |
+
RUN apt-get update && \
|
6 |
+
apt-get install -y curl && \
|
7 |
+
apt-get clean && \
|
8 |
+
rm -rf /var/lib/apt/lists/* && \
|
9 |
+
useradd -m -u 1000 user
|
10 |
|
11 |
+
# Set environment variables
|
12 |
ENV HOME=/home/user \
|
13 |
+
PATH=/home/user/.local/bin:$PATH \
|
14 |
OLLAMA_HOST=0.0.0.0 \
|
15 |
OLLAMA_ORIGINS=*
|
16 |
|
17 |
+
# Set the working directory and switch to the user
|
18 |
WORKDIR $HOME/app
|
19 |
+
USER user
|
20 |
|
21 |
+
# Copy the Modelfile to the working directory
|
22 |
COPY --chown=user:user Modelfile $HOME/app/
|
23 |
|
24 |
+
# Pull the necessary models and start the Ollama server
|
25 |
+
RUN ollama serve & \
|
26 |
+
sleep 5 && \
|
27 |
+
ollama pull llama3.2 && \
|
28 |
+
ollama pull llama3.2:1b && \
|
29 |
+
ollama pull granite3-moe && \
|
30 |
+
ollama pull granite3-moe:1b
|
31 |
|
32 |
+
# Expose the port for the Ollama server
|
33 |
EXPOSE 11434
|