rockerritesh commited on
Commit
0af61fe
·
verified ·
1 Parent(s): f928ff7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -30
Dockerfile CHANGED
@@ -1,34 +1,14 @@
1
- FROM nvidia/cuda:12.1.1-runtime-ubuntu22.04
 
2
 
3
- # Set environment variables
4
- ENV NVIDIA_VISIBLE_DEVICES=all \
5
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
6
 
7
- # Install dependencies
8
- RUN apt-get update && apt-get install -y --no-install-recommends \
9
- curl \
10
- ca-certificates \
11
- && rm -rf /var/lib/apt/lists/*
12
 
13
- # Install NVIDIA Container Toolkit
14
- RUN curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | \
15
- gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg && \
16
- curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
17
- sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
18
- tee /etc/apt/sources.list.d/nvidia-container-toolkit.list && \
19
- apt-get update && apt-get install -y --no-install-recommends nvidia-container-toolkit
20
 
21
- # Install Ollama
22
- RUN curl -fsSL https://ollama.ai/install.sh | bash
23
-
24
- # Create Ollama data directory
25
- RUN mkdir -p /.ollama
26
-
27
- # Expose port
28
- EXPOSE 11434
29
-
30
- # Set working directory
31
- WORKDIR /root/.ollama
32
-
33
- # Start Ollama
34
- CMD ["ollama", "serve"]
 
1
+ # Start with the official Ollama Docker image
2
+ FROM ollama/ollama
3
 
4
+ # Install nginx to act as a reverse proxy
5
+ RUN apt-get update && apt-get install -y nginx
 
6
 
7
+ # Copy a custom nginx configuration file
8
+ COPY nginx.conf /etc/nginx/nginx.conf
 
 
 
9
 
10
+ # Expose port 7860 (required by Hugging Face Spaces)
11
+ EXPOSE 7860
 
 
 
 
 
12
 
13
+ # Start both nginx and Ollama in the foreground
14
+ CMD service nginx start && ollama serve