Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +10 -12
Dockerfile
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
|
|
| 1 |
FROM ubuntu:latest
|
| 2 |
|
| 3 |
-
#
|
| 4 |
RUN apt-get update && apt-get install -y curl
|
| 5 |
|
| 6 |
-
# Install Ollama
|
| 7 |
RUN curl -fsSL https://ollama.com/install.sh | sh
|
| 8 |
|
| 9 |
-
# Set
|
| 10 |
ENV OLLAMA_HOST=0.0.0.0
|
| 11 |
|
| 12 |
-
# Create
|
| 13 |
RUN mkdir -p /.ollama && chmod 777 /.ollama
|
| 14 |
|
| 15 |
-
# Create
|
| 16 |
RUN mkdir -p /usr/share/ollama/.ollama/models && chmod -R 777 /usr/share/ollama/.ollama/models
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
RUN ollama pull noahabebe/baymax
|
| 20 |
-
|
| 21 |
-
# Set Ollama models environment variable
|
| 22 |
ENV OLLAMA_MODELS="/usr/share/ollama/.ollama/models"
|
| 23 |
|
| 24 |
-
# Expose the server port
|
| 25 |
EXPOSE 7860
|
| 26 |
|
| 27 |
-
# Run the Ollama server
|
| 28 |
-
CMD ollama serve
|
|
|
|
| 1 |
+
# Use the latest Ubuntu image as the base
|
| 2 |
FROM ubuntu:latest
|
| 3 |
|
| 4 |
+
# Update the package list and install curl
|
| 5 |
RUN apt-get update && apt-get install -y curl
|
| 6 |
|
| 7 |
+
# Install Ollama using the official install script
|
| 8 |
RUN curl -fsSL https://ollama.com/install.sh | sh
|
| 9 |
|
| 10 |
+
# Set the Ollama host environment variable
|
| 11 |
ENV OLLAMA_HOST=0.0.0.0
|
| 12 |
|
| 13 |
+
# Create the Ollama directory and set permissions
|
| 14 |
RUN mkdir -p /.ollama && chmod 777 /.ollama
|
| 15 |
|
| 16 |
+
# Create the models directory and set permissions
|
| 17 |
RUN mkdir -p /usr/share/ollama/.ollama/models && chmod -R 777 /usr/share/ollama/.ollama/models
|
| 18 |
|
| 19 |
+
# Set the Ollama models environment variable
|
|
|
|
|
|
|
|
|
|
| 20 |
ENV OLLAMA_MODELS="/usr/share/ollama/.ollama/models"
|
| 21 |
|
| 22 |
+
# Expose the Ollama server port
|
| 23 |
EXPOSE 7860
|
| 24 |
|
| 25 |
+
# Run the Ollama server and pull the Baymax model
|
| 26 |
+
CMD ["ollama", "serve", "&", "sleep", "5", "&&", "ollama", "pull", "noahabebe/baymax", "&&", "wait"]
|