Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +14 -15
Dockerfile
CHANGED
|
@@ -1,20 +1,17 @@
|
|
| 1 |
# Builder stage
|
| 2 |
FROM ubuntu:latest
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
RUN apt-get install -y nvidia-container-toolkit
|
| 17 |
-
|
| 18 |
RUN curl https://ollama.ai/install.sh | sh
|
| 19 |
|
| 20 |
# Create the directory and give appropriate permissions
|
|
@@ -28,10 +25,12 @@ RUN chmod +x /entrypoint.sh
|
|
| 28 |
|
| 29 |
# Set the entry point script as the default command
|
| 30 |
ENTRYPOINT ["/entrypoint.sh"]
|
|
|
|
|
|
|
| 31 |
CMD ["ollama", "serve"]
|
| 32 |
|
| 33 |
# Set the model as an environment variable (this can be overridden)
|
| 34 |
ENV model=llama2
|
| 35 |
|
| 36 |
# Expose the server port
|
| 37 |
-
EXPOSE 7860
|
|
|
|
| 1 |
# Builder stage
|
| 2 |
FROM ubuntu:latest
|
| 3 |
|
| 4 |
+
# Install dependencies
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
curl \
|
| 7 |
+
gnupg \
|
| 8 |
+
&& curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
|
| 9 |
+
&& echo "deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://nvidia.github.io/libnvidia-container/stable/deb/ $(. /etc/os-release; echo $UBUNTU_CODENAME) main" > /etc/apt/sources.list.d/nvidia-container-toolkit.list \
|
| 10 |
+
&& apt-get update \
|
| 11 |
+
&& apt-get install -y nvidia-container-toolkit \
|
| 12 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
+
|
| 14 |
+
# Install ollama
|
|
|
|
|
|
|
|
|
|
| 15 |
RUN curl https://ollama.ai/install.sh | sh
|
| 16 |
|
| 17 |
# Create the directory and give appropriate permissions
|
|
|
|
| 25 |
|
| 26 |
# Set the entry point script as the default command
|
| 27 |
ENTRYPOINT ["/entrypoint.sh"]
|
| 28 |
+
|
| 29 |
+
# Set default arguments for the entry point script
|
| 30 |
CMD ["ollama", "serve"]
|
| 31 |
|
| 32 |
# Set the model as an environment variable (this can be overridden)
|
| 33 |
ENV model=llama2
|
| 34 |
|
| 35 |
# Expose the server port
|
| 36 |
+
EXPOSE 7860
|