Pavithiran commited on
Commit
1e253c0
·
verified ·
1 Parent(s): 7080a88

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -16
Dockerfile CHANGED
@@ -1,29 +1,19 @@
1
- # Use an official lightweight Ubuntu base image
2
  FROM ubuntu:22.04
3
 
4
- # Set environment variables
5
- ENV DEBIAN_FRONTEND=noninteractive
6
- ENV OLLAMA_HOME=/home/user/.ollama
7
-
8
- # Create a non-root user to avoid permission issues
9
- RUN useradd -m -s /bin/bash user
10
-
11
  # Install dependencies
12
- RUN apt update && apt install -y \
13
- curl git && \
14
- rm -rf /var/lib/apt/lists/*
15
 
16
  # Install Ollama
17
  RUN curl -fsSL https://ollama.com/install.sh | sh
18
 
19
- # Ensure the Ollama home directory is writable
20
- RUN mkdir -p $OLLAMA_HOME && chown -R user:user $OLLAMA_HOME
21
 
22
- # Switch to non-root user
23
- USER user
24
 
25
  # Expose Ollama API port
26
  EXPOSE 11434
27
 
28
- # Start Ollama server
29
  CMD ["ollama", "serve"]
 
 
1
  FROM ubuntu:22.04
2
 
 
 
 
 
 
 
 
3
  # Install dependencies
4
+ RUN apt update && apt install -y curl git python3 python3-pip
 
 
5
 
6
  # Install Ollama
7
  RUN curl -fsSL https://ollama.com/install.sh | sh
8
 
9
+ # Pull the specified Llama 3.2 model
10
+ RUN ollama pull llama3.2:3b-instruct-fp16
11
 
12
+ # Install Python dependencies
13
+ RUN pip install langchain langchain_ollama
14
 
15
  # Expose Ollama API port
16
  EXPOSE 11434
17
 
18
+ # Run Ollama on start
19
  CMD ["ollama", "serve"]