Update Dockerfile
Browse files- Dockerfile +56 -56
Dockerfile
CHANGED
|
@@ -1,57 +1,57 @@
|
|
| 1 |
-
#Ollama-API By BleakPrestiger
|
| 2 |
-
# Builder stage
|
| 3 |
-
FROM ubuntu:latest
|
| 4 |
-
|
| 5 |
-
WORKDIR /app
|
| 6 |
-
|
| 7 |
-
COPY ..
|
| 8 |
-
|
| 9 |
-
# In your Dockerfile
|
| 10 |
-
RUN pip install huggingface_hub
|
| 11 |
-
|
| 12 |
-
# Download the model during the build process
|
| 13 |
-
RUN python -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='Qwen/Qwen3-1.7B-GGUF', filename='Qwen3-1.7B-Q8_0.gguf', local_dir='./')"
|
| 14 |
-
|
| 15 |
-
# Update packages and install curl and gnupg
|
| 16 |
-
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
|
| 17 |
-
curl \
|
| 18 |
-
wget \
|
| 19 |
-
gnupg
|
| 20 |
-
|
| 21 |
-
RUN cd llama-b6795-bin-ubuntu-x64/build/bin && chmod +x ./llama-server && ./llama-server --model Qwen3-1.7B-Q8_0.gguf --ctx-size-draft 32767 --ctx-size 32767 --temp 1.0 --top-k 64 --top-k 0.95 --min-p 0.0 --log-file llama.log &
|
| 22 |
-
|
| 23 |
-
# Copy the entry point script
|
| 24 |
-
#COPY entrypoint.sh /entrypoint.sh
|
| 25 |
-
RUN chmod +x /entrypoint.sh
|
| 26 |
-
|
| 27 |
-
# Set the entry point script as the default command
|
| 28 |
-
ENTRYPOINT ["/entrypoint.sh"]
|
| 29 |
-
#CMD ["ollama", "serve"]
|
| 30 |
-
|
| 31 |
-
# Expose the server port
|
| 32 |
-
EXPOSE 7860
|
| 33 |
-
|
| 34 |
-
# Add NVIDIA package repositories
|
| 35 |
-
#RUN curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
|
| 36 |
-
#&& 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
|
| 37 |
-
|
| 38 |
-
# Install NVIDIA container toolkit (Check for any updated methods or URLs for Ubuntu jammy)
|
| 39 |
-
#RUN apt-get update && apt-get install -y nvidia-container-toolkit || true
|
| 40 |
-
|
| 41 |
-
# Install application
|
| 42 |
-
#RUN curl https://ollama.ai/install.sh | sh
|
| 43 |
-
# Below is to fix embedding bug as per
|
| 44 |
-
# 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
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
# Create the directory and give appropriate permissions
|
| 48 |
-
#RUN mkdir -p /.ollama && chmod 777 /.ollama
|
| 49 |
-
|
| 50 |
-
#WORKDIR /.ollama
|
| 51 |
-
|
| 52 |
-
# Set the entry point script as the default command
|
| 53 |
-
#ENTRYPOINT ["/entrypoint.sh"]
|
| 54 |
-
#CMD ["ollama", "serve"]
|
| 55 |
-
|
| 56 |
-
# Set the model as an environment variable (this can be overridden)
|
| 57 |
#ENV model=${model}
|
|
|
|
| 1 |
+
#Ollama-API By BleakPrestiger
|
| 2 |
+
# Builder stage
|
| 3 |
+
FROM ubuntu:latest
|
| 4 |
+
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
COPY .. app
|
| 8 |
+
|
| 9 |
+
# In your Dockerfile
|
| 10 |
+
RUN pip install huggingface_hub
|
| 11 |
+
|
| 12 |
+
# Download the model during the build process
|
| 13 |
+
RUN python -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='Qwen/Qwen3-1.7B-GGUF', filename='Qwen3-1.7B-Q8_0.gguf', local_dir='./')"
|
| 14 |
+
|
| 15 |
+
# Update packages and install curl and gnupg
|
| 16 |
+
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
|
| 17 |
+
curl \
|
| 18 |
+
wget \
|
| 19 |
+
gnupg
|
| 20 |
+
|
| 21 |
+
RUN cd llama-b6795-bin-ubuntu-x64/build/bin && chmod +x ./llama-server && ./llama-server --model Qwen3-1.7B-Q8_0.gguf --ctx-size-draft 32767 --ctx-size 32767 --temp 1.0 --top-k 64 --top-k 0.95 --min-p 0.0 --log-file llama.log &
|
| 22 |
+
|
| 23 |
+
# Copy the entry point script
|
| 24 |
+
#COPY entrypoint.sh /entrypoint.sh
|
| 25 |
+
RUN chmod +x /entrypoint.sh
|
| 26 |
+
|
| 27 |
+
# Set the entry point script as the default command
|
| 28 |
+
ENTRYPOINT ["/entrypoint.sh"]
|
| 29 |
+
#CMD ["ollama", "serve"]
|
| 30 |
+
|
| 31 |
+
# Expose the server port
|
| 32 |
+
EXPOSE 7860
|
| 33 |
+
|
| 34 |
+
# Add NVIDIA package repositories
|
| 35 |
+
#RUN curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
|
| 36 |
+
#&& 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
|
| 37 |
+
|
| 38 |
+
# Install NVIDIA container toolkit (Check for any updated methods or URLs for Ubuntu jammy)
|
| 39 |
+
#RUN apt-get update && apt-get install -y nvidia-container-toolkit || true
|
| 40 |
+
|
| 41 |
+
# Install application
|
| 42 |
+
#RUN curl https://ollama.ai/install.sh | sh
|
| 43 |
+
# Below is to fix embedding bug as per
|
| 44 |
+
# 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
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
# Create the directory and give appropriate permissions
|
| 48 |
+
#RUN mkdir -p /.ollama && chmod 777 /.ollama
|
| 49 |
+
|
| 50 |
+
#WORKDIR /.ollama
|
| 51 |
+
|
| 52 |
+
# Set the entry point script as the default command
|
| 53 |
+
#ENTRYPOINT ["/entrypoint.sh"]
|
| 54 |
+
#CMD ["ollama", "serve"]
|
| 55 |
+
|
| 56 |
+
# Set the model as an environment variable (this can be overridden)
|
| 57 |
#ENV model=${model}
|