Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +1 -11
Dockerfile
CHANGED
|
@@ -1,12 +1,5 @@
|
|
| 1 |
FROM ollama/ollama:latest
|
| 2 |
|
| 3 |
-
# Create a user and set up permissions
|
| 4 |
-
RUN useradd -ms /bin/bash ollama-user
|
| 5 |
-
|
| 6 |
-
# Set the home directory
|
| 7 |
-
ENV HOME=/home/ollama-user
|
| 8 |
-
WORKDIR $HOME
|
| 9 |
-
|
| 10 |
# Use /tmp for Ollama data (writable by all users)
|
| 11 |
ENV OLLAMA_HOME=/tmp/ollama
|
| 12 |
RUN mkdir -p /tmp/ollama && chmod 777 /tmp/ollama
|
|
@@ -14,15 +7,12 @@ RUN mkdir -p /tmp/ollama && chmod 777 /tmp/ollama
|
|
| 14 |
# Install netcat-openbsd (more reliable than netcat)
|
| 15 |
RUN apt-get update && apt-get install -y netcat-openbsd && rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
-
# Copy the entrypoint script
|
| 18 |
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
| 19 |
|
| 20 |
# Set permissions for the entrypoint script
|
| 21 |
RUN chmod +x /usr/local/bin/entrypoint.sh
|
| 22 |
|
| 23 |
-
# Switch to the non-root user
|
| 24 |
-
USER ollama-user
|
| 25 |
-
|
| 26 |
# Set Ollama to listen on all network interfaces
|
| 27 |
ENV OLLAMA_HOST=0.0.0.0:7860
|
| 28 |
|
|
|
|
| 1 |
FROM ollama/ollama:latest
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
# Use /tmp for Ollama data (writable by all users)
|
| 4 |
ENV OLLAMA_HOME=/tmp/ollama
|
| 5 |
RUN mkdir -p /tmp/ollama && chmod 777 /tmp/ollama
|
|
|
|
| 7 |
# Install netcat-openbsd (more reliable than netcat)
|
| 8 |
RUN apt-get update && apt-get install -y netcat-openbsd && rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
+
# Copy the entrypoint script
|
| 11 |
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
| 12 |
|
| 13 |
# Set permissions for the entrypoint script
|
| 14 |
RUN chmod +x /usr/local/bin/entrypoint.sh
|
| 15 |
|
|
|
|
|
|
|
|
|
|
| 16 |
# Set Ollama to listen on all network interfaces
|
| 17 |
ENV OLLAMA_HOST=0.0.0.0:7860
|
| 18 |
|