madiator-docker-runpod/official-templates/better-ollama/Dockerfile

40 lines
1.2 KiB
Text
Raw Permalink Normal View History

2024-07-11 20:32:39 +02:00
# Base Image
2024-07-13 20:21:22 +02:00
FROM madiator2011/better-pytorch:cuda12.4
2024-07-11 20:32:39 +02:00
# Install necessary dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
2024-07-13 20:21:22 +02:00
lshw \
2024-07-11 20:32:39 +02:00
&& rm -rf /var/lib/apt/lists/*
2024-07-13 20:21:22 +02:00
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb && \
dpkg -i cuda-keyring_1.1-1_all.deb && \
apt-get update && \
apt-get -y install cuda-toolkit-12-4 && \
rm cuda-keyring_1.1-1_all.deb
2024-07-11 20:32:39 +02:00
# Download and install Ollama
2024-08-06 12:43:10 +02:00
RUN curl -L https://github.com/ollama/ollama/releases/download/v0.3.3/ollama-linux-amd64 -o /usr/bin/ollama && \
2024-07-11 20:32:39 +02:00
chmod +x /usr/bin/ollama
COPY settings.json /root/.local/share/code-server/User/settings.json
COPY tasks.json /root/.local/share/code-server/User/tasks.json
# Start Scripts
COPY --from=scripts start.sh /
RUN chmod +x /start.sh
# Set environment variables for runtime
ENV OLLAMA_HOST=0.0.0.0
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
ENV NVIDIA_VISIBLE_DEVICES=all
# Expose the required port
EXPOSE 11434
CMD ["/start.sh"]