Echo-ai commited on
Commit
27abc53
·
verified ·
1 Parent(s): e00b411

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -6
Dockerfile CHANGED
@@ -1,6 +1,25 @@
1
- FROM python:3.9
2
- RUN apt-get update && apt-get install -y curl
3
- RUN curl -L https://ollama.com/install.sh | sh
4
- COPY . /app
5
- WORKDIR /app
6
- CMD ["sh", "start.sh"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ # Install curl and Ollama
4
+ RUN apt-get update && apt-get install -y curl && \
5
+ curl -fsSL https://ollama.ai/install.sh | sh && \
6
+ apt-get clean && rm -rf /var/lib/apt/lists/*
7
+
8
+ # Set up user and environment
9
+ RUN useradd -m -u 1000 user
10
+ USER user
11
+ ENV HOME=/home/user PATH="/home/user/.local/bin:$PATH"
12
+ WORKDIR $HOME/app
13
+
14
+ # Copy and install Python dependencies
15
+ COPY --chown=user requirements.txt .
16
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
17
+
18
+ # Copy the rest of the app
19
+ COPY --chown=user . .
20
+
21
+ # Make the start script executable
22
+ RUN chmod +x start.sh
23
+
24
+ # Start Ollama and the app
25
+ CMD ["./start.sh"]