Spaces:
Runtime error
Runtime error
DeathDaDev
commited on
Commit
•
ae00b8b
1
Parent(s):
3f09d3b
Update Dockerfile
Browse files- Dockerfile +19 -10
Dockerfile
CHANGED
@@ -1,14 +1,19 @@
|
|
1 |
-
# Use the latest Ollama base image
|
2 |
from ollama/ollama:latest
|
3 |
|
4 |
-
# Update package manager and install
|
5 |
-
Run apt-get update && apt-get install
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
# Create a non-root user 'user' with UID 1000
|
8 |
Run useradd -m -u 1000 user
|
9 |
|
10 |
# Set environment variables
|
11 |
-
User User
|
12 |
env HOME=/home/user \
|
13 |
PATH=/home/user/.local/bin:$PATH \
|
14 |
OLLAMA_HOST=0.0.0.0
|
@@ -16,13 +21,17 @@ env HOME=/home/user \
|
|
16 |
# Set the working directory
|
17 |
WORKDIR $HOME/app
|
18 |
|
19 |
-
#
|
20 |
-
|
21 |
|
22 |
-
#
|
23 |
-
|
|
|
|
|
|
|
24 |
|
25 |
# Expose port 11434 for Ollama and 5000 for the web server
|
26 |
EXPOSE 11434 5000
|
27 |
-
|
28 |
-
|
|
|
|
1 |
+
# # Use the latest Ollama base image
|
2 |
from ollama/ollama:latest
|
3 |
|
4 |
+
# Update package manager and install necessary packages
|
5 |
+
Run apt-get update && apt-get install -y \
|
6 |
+
curl \
|
7 |
+
python3-pip \
|
8 |
+
&& rm -rf /var/lib/apt/lists/*
|
9 |
+
|
10 |
+
# Install Flask
|
11 |
+
Run pip3 install flask
|
12 |
|
13 |
# Create a non-root user 'user' with UID 1000
|
14 |
Run useradd -m -u 1000 user
|
15 |
|
16 |
# Set environment variables
|
|
|
17 |
env HOME=/home/user \
|
18 |
PATH=/home/user/.local/bin:$PATH \
|
19 |
OLLAMA_HOST=0.0.0.0
|
|
|
21 |
# Set the working directory
|
22 |
WORKDIR $HOME/app
|
23 |
|
24 |
+
# Copy the Python script for the web server
|
25 |
+
Copy app.py .
|
26 |
|
27 |
+
# Change ownership of the working directory to the non-root user
|
28 |
+
Run chown -R user:user $HOME/app
|
29 |
+
|
30 |
+
# Switch to the non-root user
|
31 |
+
User User
|
32 |
|
33 |
# Expose port 11434 for Ollama and 5000 for the web server
|
34 |
EXPOSE 11434 5000
|
35 |
+
|
36 |
+
# Start Ollama server and the Flask web server
|
37 |
+
cmd ollama serve & python3 app.py
|