DeathDaDev commited on
Commit
ae00b8b
1 Parent(s): 3f09d3b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. 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 curl
5
- Run apt-get update && apt-get install curl -y
 
 
 
 
 
 
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
- # Download the model file llama.gguf (if needed)
20
- # RUN curl -fsSL https://huggingface.co/gingdev/llama7b-ictu-v2/resolve/main/llama7b_q4_k_m.gguf?download=true -o llama.gguf
21
 
22
- # Start Ollama server
23
- cmd ["serve"]
 
 
 
24
 
25
  # Expose port 11434 for Ollama and 5000 for the web server
26
  EXPOSE 11434 5000
27
- Run apt-get update && apt-get install python3-pip -y
28
- Run pip3 install flask
 
 
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