Update Dockerfile
Browse files123456789101112131415161718FROM ghcr.io/ggerganov/llama.cpp:server# Install wgetRUN apt-get update && apt-get install -y wgetRUN mkdir -p /models/7B# Create a directory to store the downloaded fileWORKDIR /app# Download the fileRUN wget -O /models/7B/ggml-model.gguf "https://huggingface.co/openbmb/MiniCPM-Llama3-V-2_5-gguf/resolve/main/ggml-model-Q3_K.gguf?download=true"# Expose the portEXPOSE 8080# Command to run your application with the required argumentsCMD ["-m", "/models/7B/ggml-model.gguf", "-c", "512", "--host", "0.0.0.0", "--port", "8080"]1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162# Builder stage# FROM ubuntu:latest# # Update packages and install curl and gnupg# RUN apt-get update && apt-get install -y \# curl \# gnupg# # Add NVIDIA package repositories# RUN curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \# && 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# # Install NVIDIA container toolkit (Check for any updated methods or URLs for Ubuntu jammy)# RUN apt-get update && apt-get install -y nvidia-container-toolkit || true# # Install application# RUN curl https://ollama.ai/install.sh | sh# # Below is to fix embedding bug as per# # 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# # Create the directory and give appropriate permissions# RUN mkdir -p /.ollama && chmod 777 /.ollama# WORKDIR /.ollama# # Copy the entry point script# COPY entrypoint.sh /entrypoint.sh# RUN chmod +x /entrypoint.sh# # Set the entry point script as the default command# ENTRYPOINT ["/entrypoint.sh"]# CMD ["ollama", "serve"]# # Set the model as an environment variable (this can be overridden)# ENV model=${model}# Expose the server port# Use the official Ollama Docker image as the base imageFROM ollama/ollama:latest# Create a directory for Ollama dataRUN mkdir -p /.ollamaRUN chmod -R 777 /.ollamaWORKDIR /.ollama# Copy the entry point scriptCOPY entrypoint.sh /entrypoint.shRUN chmod +x /entrypoint.sh# Set the entry point script as the default commandENTRYPOINT ["/entrypoint.sh"]# Set the model as an environment variable (this can be overridden)ENV model=${model}# Expose the port that Ollama runs onEXPOSE 7860# Command to start the Ollama serverCMD ["serve"]
Dockerfile+56-12