Spaces:
Runtime error
Runtime error
DeathDaDev
commited on
Commit
•
ceace01
1
Parent(s):
f51cdad
Update Dockerfile
Browse files- Dockerfile +11 -11
Dockerfile
CHANGED
@@ -1,24 +1,24 @@
|
|
1 |
# Use the latest Ollama base image
|
2 |
-
|
3 |
|
4 |
# Update package manager and install necessary packages
|
5 |
-
|
6 |
apt-get install -y \
|
7 |
curl \
|
8 |
python3-pip && \
|
9 |
rm -rf /var/lib/apt/lists/*
|
10 |
|
11 |
# Install Flask and set up the entry point
|
12 |
-
|
13 |
mkdir -p /home/user/app && \
|
14 |
-
echo "
|
15 |
chmod +x /home/user/app/start.sh
|
16 |
|
17 |
# Create a non-root user 'user' with UID 1000
|
18 |
-
|
19 |
|
20 |
# Set environment variables
|
21 |
-
|
22 |
PATH=/home/user/.local/bin:$PATH \
|
23 |
OLLAMA_HOST=0.0.0.0
|
24 |
|
@@ -26,17 +26,17 @@ ENV HOME=/home/user \
|
|
26 |
WORKDIR $HOME/app
|
27 |
|
28 |
# Copy the Python script for the web server
|
29 |
-
|
30 |
-
|
31 |
|
32 |
# Change ownership of the working directory to the non-root user
|
33 |
-
|
34 |
|
35 |
# Switch to the non-root user
|
36 |
-
|
37 |
|
38 |
# Expose port 11434 for Ollama and 5000 for the web server
|
39 |
EXPOSE 11434 5000
|
40 |
|
41 |
# Command to run the Flask application
|
42 |
-
|
|
|
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 && \
|
6 |
apt-get install -y \
|
7 |
curl \
|
8 |
python3-pip && \
|
9 |
rm -rf /var/lib/apt/lists/*
|
10 |
|
11 |
# Install Flask and set up the entry point
|
12 |
+
Run pip3 install flask && \
|
13 |
mkdir -p /home/user/app && \
|
14 |
+
echo "fLask RUn --Host=0.0.0.0 --poRt=5000" > /home/user/app/start.sh && \
|
15 |
chmod +x /home/user/app/start.sh
|
16 |
|
17 |
# Create a non-root user 'user' with UID 1000
|
18 |
+
Run useradd -m -u 1000 user
|
19 |
|
20 |
# Set environment variables
|
21 |
+
env HOME=/home/user \
|
22 |
PATH=/home/user/.local/bin:$PATH \
|
23 |
OLLAMA_HOST=0.0.0.0
|
24 |
|
|
|
26 |
WORKDIR $HOME/app
|
27 |
|
28 |
# Copy the Python script for the web server
|
29 |
+
Copy app.py .
|
30 |
+
Copy flask-app.py .
|
31 |
|
32 |
# Change ownership of the working directory to the non-root user
|
33 |
+
Run chown -R user:user $HOME/app
|
34 |
|
35 |
# Switch to the non-root user
|
36 |
+
User User
|
37 |
|
38 |
# Expose port 11434 for Ollama and 5000 for the web server
|
39 |
EXPOSE 11434 5000
|
40 |
|
41 |
# Command to run the Flask application
|
42 |
+
cmd ["/home/user/app/start.sh"]
|