Skip to content

Commit

Permalink
llama-cpp-python: some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
3x3cut0r committed Oct 30, 2023
1 parent ed7b89f commit 5ea4d62
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions llama-cpp-python/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
ARG IMAGE=python:3.12-alpine

# Build-Stage
# App-Stage
FROM ${IMAGE}
ARG IMAGE

LABEL maintainer="Julian Reith <julianreith@gmx.de>"
LABEL description="Docker container for llama-cpp-python"

Expand All @@ -11,7 +12,7 @@ WORKDIR /
VOLUME /model
EXPOSE 8000/tcp

# setup
# Setup llama-cpp-python
RUN apk add --no-cache --virtual .build-deps build-base cmake ninja-build && \
apk add --no-cache curl openblas-dev runit tzdata && \
rm -rf /var/lib/apt/lists/* && \
Expand Down Expand Up @@ -40,13 +41,14 @@ RUN apk add --no-cache --virtual .build-deps build-base cmake ninja-build && \
chmod +x /runit-services/syslogd/run \
/runit-services/llama-cpp-python/run

# export versions in /VERSION
# Store versions in /VERSION
RUN touch /VERSION && \
echo "alpine=$(cat /etc/alpine-release)" > /VERSION && \
echo "python=$(/venv/bin/python3 --version | cut -d' ' -f2)" >> /VERSION && \
echo "pip=$(/venv/bin/pip3 --version| cut -d' ' -f2)" >> /VERSION && \
echo "llama-cpp-python=$(/venv/bin/pip freeze | grep llama_cpp_python | cut -d= -f3)" >> /VERSION

# Setup environment
ENV TZ="UTC" \
MODEL="/model/Llama-2-7b-Chat-GGUF/llama-2-7b-chat.Q2_K.gguf" \
DEFAULT_MODEL="llama-2-7b-chat.Q2_K.gguf" \
Expand Down Expand Up @@ -80,9 +82,9 @@ ENV TZ="UTC" \
PORT=8000 \
INTERRUPT_REQUESTS=True

# Setup entrypoint
COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh

ENTRYPOINT ["/docker-entrypoint.sh"]

HEALTHCHECK --interval=5s --timeout=10s --retries=3 \
Expand Down

0 comments on commit 5ea4d62

Please sign in to comment.