danghungithp commited on
Commit
9c2fa8b
·
verified ·
1 Parent(s): 3633e26

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -7
Dockerfile CHANGED
@@ -1,19 +1,23 @@
1
- FROM ollama/ollama:0.1.44
2
 
3
  # Cài đặt các công cụ cần thiết: Python, pip, curl
4
  RUN apt-get update && apt-get install -y python3 python3-pip curl
5
 
6
- # Sao chép cài đặt các dependencies của Python
 
 
 
 
 
 
7
  COPY requirements.txt .
8
  RUN pip3 install -r requirements.txt
9
 
10
- # Sao chép mã nguồn ứng dụng
11
  COPY . /app
12
- WORKDIR /app
13
 
14
- # Create and configure the Ollama directory
15
- RUN mkdir -p /app/ollama && chown -R ollama:ollama /app/ollama
16
- ENV OLLAMA_HOME=/app/ollama
17
 
18
  # Start the application
19
  ENTRYPOINT ["ollama", "serve"]
 
1
+ FROM docker.io/ollama/ollama:0.1.44@sha256:1174d6119998bb10f5af2437e7aeeb934726e37268f0d66f200f6cfd9fb20578
2
 
3
  # Cài đặt các công cụ cần thiết: Python, pip, curl
4
  RUN apt-get update && apt-get install -y python3 python3-pip curl
5
 
6
+ # Update package list and install dependencies
7
+ RUN apt-get update && apt-get install -y python3 python3-pip curl && \
8
+ useradd -m -r ollama && \
9
+ mkdir -p /app/ollama && \
10
+ chown -R ollama:ollama /app/ollama
11
+
12
+ # Copy requirements and install them
13
  COPY requirements.txt .
14
  RUN pip3 install -r requirements.txt
15
 
16
+ # Copy application code
17
  COPY . /app
 
18
 
19
+ # Set working directory
20
+ WORKDIR /app
 
21
 
22
  # Start the application
23
  ENTRYPOINT ["ollama", "serve"]