subhrajit-mohanty commited on
Commit
ce49283
·
verified ·
1 Parent(s): 1b8e877

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -15
Dockerfile CHANGED
@@ -1,27 +1,18 @@
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
- # Ensure the user has access to the directory
11
- RUN mkdir -p $HOME/.ollama && chown -R ollama-user:ollama-user $HOME/.ollama
12
-
13
- # Install netcat (nc) for checking server readiness
14
- RUN apt-get update && apt-get install -y netcat
15
-
16
- # Copy the entrypoint script before switching users
17
  COPY entrypoint.sh /usr/local/bin/entrypoint.sh
18
 
19
  # Set permissions for the entrypoint script
20
  RUN chmod +x /usr/local/bin/entrypoint.sh
21
 
22
- # Switch to the non-root user
23
- USER ollama-user
24
-
25
  # Set Ollama to listen on all network interfaces
26
  ENV OLLAMA_HOST=0.0.0.0:7860
27
 
 
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
6
 
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