robinroy03 commited on
Commit
af5ae78
·
verified ·
1 Parent(s): 0c8dc62

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +36 -6
Dockerfile CHANGED
@@ -1,10 +1,40 @@
1
- FROM ollama/ollama
 
2
 
3
- WORKDIR /code
4
- RUN mkdir -p /code && chmod 777 /code
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  RUN mkdir -p /.ollama && chmod 777 /.ollama
6
 
7
- ENV OLLAMA_MAX_LOADED_MODELS=20 --OLLAMA_NUM_PARALLEL=20
8
- ENV OLLAMA_HOST "130.130.130.130:8080"
 
 
 
 
 
 
 
 
 
 
9
 
10
- CMD ["serve"]
 
 
1
+ # Builder stage
2
+ FROM ubuntu:latest
3
 
4
+ # Update packages and install curl and gnupg
5
+ RUN apt-get update && apt-get install -y \
6
+ curl \
7
+ gnupg
8
+
9
+ # Add NVIDIA package repositories
10
+
11
+ # RUN curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
12
+ # && echo "deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://nvidia.github.io/libnvidia-container/stable/deb/ $(. /etc/os-release; echo $UBUNTU_CODENAME) main" > /etc/apt/sources.list.d/nvidia-container-toolkit.list
13
+
14
+ # Install NVIDIA container toolkit (Check for any updated methods or URLs for Ubuntu jammy)
15
+ # RUN apt-get update && apt-get install -y nvidia-container-toolkit || true
16
+
17
+ # Install application
18
+ RUN curl https://ollama.ai/install.sh | sh
19
+ # Below is to fix embedding bug as per
20
+ # RUN curl -fsSL https://ollama.com/install.sh | sed 's#https://ollama.com/download#https://github.com/jmorganca/ollama/releases/download/v0.1.29#' | sh
21
+
22
+
23
+ # Create the directory and give appropriate permissions
24
  RUN mkdir -p /.ollama && chmod 777 /.ollama
25
 
26
+ WORKDIR /.ollama
27
+
28
+ # Copy the entry point script
29
+ COPY entrypoint.sh /entrypoint.sh
30
+ RUN chmod +x /entrypoint.sh
31
+
32
+ # Set the entry point script as the default command
33
+ ENTRYPOINT ["/entrypoint.sh"]
34
+ CMD ["ollama", "serve"]
35
+
36
+ # Set the model as an environment variable (this can be overridden)
37
+ ENV model=${model}
38
 
39
+ # Expose the server port
40
+ EXPOSE 7860