forked from SvenBrnn/runpod-worker-ollama
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (35 loc) · 1.33 KB
/
Dockerfile
File metadata and controls
45 lines (35 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
ARG OLLAMA_VERSION=0.17.7
# Use an official base${OLLAMA_VERSION} image with your desired version
FROM ollama/ollama:${OLLAMA_VERSION}
ENV PYTHONUNBUFFERED=1
# Set up the working directory
WORKDIR /
RUN apt-get update --yes --quiet && DEBIAN_FRONTEND=noninteractive apt-get install --yes --quiet --no-install-recommends \
software-properties-common \
gpg-agent \
build-essential apt-utils \
&& apt-get install --reinstall ca-certificates \
&& add-apt-repository --yes ppa:deadsnakes/ppa && apt update --yes --quiet \
&& DEBIAN_FRONTEND=noninteractive apt-get install --yes --quiet --no-install-recommends \
python3.11 \
python3.11-dev \
python3.11-distutils \
python3.11-lib2to3 \
python3.11-gdbm \
python3.11-tk \
bash \
curl && \
ln -s /usr/bin/python3.11 /usr/bin/python && \
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /work
# Add my src as /work
ADD ./src /work
# Set defaut ollama models directory to /runpod-volume where runpod will mount the volume by default
ENV OLLAMA_MODELS="/runpod-volume"
# Install runpod and its dependencies
RUN pip install -r requirements.txt && chmod +x /work/start.sh
# Set the entrypoint
ENTRYPOINT ["/bin/sh", "-c", "/work/start.sh"]