Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +20 -11
Dockerfile
CHANGED
@@ -1,17 +1,26 @@
|
|
1 |
-
|
2 |
-
FROM ubuntu:latest
|
3 |
|
4 |
-
|
|
|
|
|
|
|
5 |
|
6 |
-
|
|
|
|
|
7 |
|
8 |
-
#
|
9 |
-
|
10 |
|
11 |
-
|
12 |
|
13 |
-
#
|
14 |
-
|
15 |
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM ollama/ollama AS base
|
|
|
2 |
|
3 |
+
# Create the /.ollama directory and ensure it has the right permissions
|
4 |
+
USER root
|
5 |
+
RUN mkdir -p /.ollama && \
|
6 |
+
chmod -R 777 /.ollama
|
7 |
|
8 |
+
# Copy your scripts and set them up
|
9 |
+
COPY ollama-pull.sh /ollama-pull.sh
|
10 |
+
RUN chmod +x /ollama-pull.sh
|
11 |
|
12 |
+
# Switch to your application's user if it doesn't require root
|
13 |
+
# USER appuser
|
14 |
|
15 |
+
ENV model="llama2"
|
16 |
|
17 |
+
# Run your script as the last step of the build process
|
18 |
+
RUN /ollama-pull.sh
|
19 |
|
20 |
+
FROM base AS final-stage
|
21 |
+
|
22 |
+
# Setup entrypoint and default command
|
23 |
+
ENTRYPOINT ["/bin/ollama"]
|
24 |
+
EXPOSE 11434
|
25 |
+
ENV OLLAMA_HOST 0.0.0.0
|
26 |
+
CMD ["serve"]
|