27 lines
664 B
Docker
27 lines
664 B
Docker
# Dockerfile: Ollama with NVIDIA GPU support
|
|
# Base image with CUDA support for NVIDIA GPU acceleration
|
|
FROM nvidia/cuda:12.3.2-base-ubuntu22.04
|
|
|
|
# Avoid interactive prompts during package install
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
# Install dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
curl \
|
|
ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Ollama
|
|
RUN curl -fsSL https://ollama.com/install.sh | sh
|
|
|
|
# Expose Ollama API port
|
|
EXPOSE 11434
|
|
|
|
# Set Ollama host to listen on all interfaces
|
|
ENV OLLAMA_HOST=0.0.0.0
|
|
|
|
# Copy entrypoint script
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|