Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +11 -10
Dockerfile
CHANGED
@@ -1,23 +1,25 @@
|
|
1 |
# Builder stage
|
2 |
FROM ubuntu:latest
|
3 |
|
4 |
-
# Update packages and install
|
5 |
RUN apt-get update && apt-get install -y \
|
6 |
curl \
|
7 |
-
gnupg
|
|
|
|
|
8 |
|
9 |
# Add NVIDIA package repositories
|
10 |
RUN curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
|
11 |
&& 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
|
12 |
|
13 |
-
# Install NVIDIA container toolkit
|
14 |
RUN apt-get update && apt-get install -y nvidia-container-toolkit || true
|
15 |
|
16 |
-
# Install
|
17 |
RUN curl https://ollama.ai/install.sh | sh
|
18 |
-
# Below is to fix embedding bug as per
|
19 |
-
# 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
|
20 |
|
|
|
|
|
21 |
|
22 |
# Create the directory and give appropriate permissions
|
23 |
RUN mkdir -p /.ollama && chmod 777 /.ollama
|
@@ -28,12 +30,11 @@ WORKDIR /.ollama
|
|
28 |
COPY entrypoint.sh /entrypoint.sh
|
29 |
RUN chmod +x /entrypoint.sh
|
30 |
|
|
|
|
|
|
|
31 |
# Set the entry point script as the default command
|
32 |
ENTRYPOINT ["/entrypoint.sh"]
|
33 |
-
CMD ["ollama", "serve"]
|
34 |
-
|
35 |
-
# Set the model as an environment variable (this can be overridden)
|
36 |
-
ENV model=${model}
|
37 |
|
38 |
# Expose the server port
|
39 |
EXPOSE 7860
|
|
|
1 |
# Builder stage
|
2 |
FROM ubuntu:latest
|
3 |
|
4 |
+
# Update packages and install necessary dependencies
|
5 |
RUN apt-get update && apt-get install -y \
|
6 |
curl \
|
7 |
+
gnupg \
|
8 |
+
python3 \
|
9 |
+
python3-pip
|
10 |
|
11 |
# Add NVIDIA package repositories
|
12 |
RUN curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
|
13 |
&& 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
|
14 |
|
15 |
+
# Install NVIDIA container toolkit
|
16 |
RUN apt-get update && apt-get install -y nvidia-container-toolkit || true
|
17 |
|
18 |
+
# Install Ollama
|
19 |
RUN curl https://ollama.ai/install.sh | sh
|
|
|
|
|
20 |
|
21 |
+
# Fix embedding bug (optional)
|
22 |
+
# 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
|
23 |
|
24 |
# Create the directory and give appropriate permissions
|
25 |
RUN mkdir -p /.ollama && chmod 777 /.ollama
|
|
|
30 |
COPY entrypoint.sh /entrypoint.sh
|
31 |
RUN chmod +x /entrypoint.sh
|
32 |
|
33 |
+
# Copy the application script
|
34 |
+
COPY app.py /app.py
|
35 |
+
|
36 |
# Set the entry point script as the default command
|
37 |
ENTRYPOINT ["/entrypoint.sh"]
|
|
|
|
|
|
|
|
|
38 |
|
39 |
# Expose the server port
|
40 |
EXPOSE 7860
|