YussefGAFeer commited on
Commit
6df1254
·
verified ·
1 Parent(s): ebec9eb

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +44 -0
Dockerfile ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #Ollama-API By BleakPrestiger
2
+ # Builder stage
3
+ FROM ubuntu:latest
4
+
5
+ # Update packages and install curl and gnupg
6
+ RUN apt-get update && apt-get install -y \
7
+ curl \
8
+ gnupg
9
+
10
+ # Add NVIDIA package repositories
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
+ RUN ollama list
26
+ RUN ollama pull gemma3n:2b
27
+ RUN ollama pull codeqwen:7b
28
+ RUN ollama list
29
+
30
+ WORKDIR /.ollama
31
+
32
+ # Copy the entry point script
33
+ COPY entrypoint.sh /entrypoint.sh
34
+ RUN chmod +x /entrypoint.sh
35
+
36
+ # Set the entry point script as the default command
37
+ ENTRYPOINT ["/entrypoint.sh"]
38
+ CMD ["ollama", "serve"]
39
+
40
+ # Set the model as an environment variable (this can be overridden)
41
+ ENV model=${model}
42
+
43
+ # Expose the server port
44
+ EXPOSE 7860