subhrajit-mohanty
commited on
Update Dockerfile
Browse files- Dockerfile +7 -5
Dockerfile
CHANGED
@@ -10,7 +10,13 @@ WORKDIR $HOME
|
|
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 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
USER ollama-user
|
15 |
|
16 |
# Set Ollama to listen on all network interfaces
|
@@ -19,9 +25,5 @@ ENV OLLAMA_HOST=0.0.0.0:7860
|
|
19 |
# Expose the default port
|
20 |
EXPOSE 7860
|
21 |
|
22 |
-
# Copy the entrypoint script
|
23 |
-
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
24 |
-
RUN chmod +x /usr/local/bin/entrypoint.sh
|
25 |
-
|
26 |
# Use the custom entrypoint script
|
27 |
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
|
|
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 |
+
# Copy the entrypoint script before switching users
|
14 |
+
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
15 |
+
|
16 |
+
# Set permissions for the entrypoint script
|
17 |
+
RUN chmod +x /usr/local/bin/entrypoint.sh
|
18 |
+
|
19 |
+
# Switch to the non-root user
|
20 |
USER ollama-user
|
21 |
|
22 |
# Set Ollama to listen on all network interfaces
|
|
|
25 |
# Expose the default port
|
26 |
EXPOSE 7860
|
27 |
|
|
|
|
|
|
|
|
|
28 |
# Use the custom entrypoint script
|
29 |
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|