Update Dockerfile
Browse files- Dockerfile +10 -30
Dockerfile
CHANGED
@@ -1,34 +1,14 @@
|
|
1 |
-
|
|
|
2 |
|
3 |
-
#
|
4 |
-
|
5 |
-
NVIDIA_DRIVER_CAPABILITIES=compute,utility
|
6 |
|
7 |
-
#
|
8 |
-
|
9 |
-
curl \
|
10 |
-
ca-certificates \
|
11 |
-
&& rm -rf /var/lib/apt/lists/*
|
12 |
|
13 |
-
#
|
14 |
-
|
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 |
-
#
|
22 |
-
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|