File tree Expand file tree Collapse file tree 3 files changed +44
-0
lines changed
Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,12 @@ deploy.gh-docs:
3636test :
3737 python3 -m pytest
3838
39+ docker :
40+ docker build -t llama-cpp-python:latest -f docker/simple/Dockerfile .
41+
42+ run-server :
43+ uvicorn --factory llama.server:app --host ${HOST} --port ${PORT}
44+
3945clean :
4046 - cd vendor/llama.cpp && make clean
4147 - cd vendor/llama.cpp && rm libllama.so
5662 build.sdist \
5763 deploy.pypi \
5864 deploy.gh-docs \
65+ docker \
5966 clean
Original file line number Diff line number Diff line change 1+ # Define the image argument and provide a default value
2+ ARG IMAGE=python:3-slim-bullseye
3+
4+ # Use the image as specified
5+ FROM ${IMAGE}
6+
7+ # Re-declare the ARG after FROM
8+ ARG IMAGE
9+
10+ # Update and upgrade the existing packages
11+ RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
12+ python3 \
13+ python3-pip \
14+ ninja-build \
15+ build-essential
16+
17+ RUN mkdir /app
18+ WORKDIR /app
19+ COPY . /app
20+
21+ RUN python3 -m pip install --upgrade pip pytest cmake scikit-build setuptools fastapi uvicorn sse-starlette
22+
23+ RUN make build && make clean
24+
25+ # Set environment variable for the host
26+ ENV HOST=0.0.0.0
27+ ENV PORT=8000
28+
29+ # Expose a port for the server
30+ EXPOSE 8000
31+
32+ # Run the server start script
33+ CMD ["/bin/sh" , "/app/docker/simple/run.sh" ]
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ make build
4+ uvicorn --factory llama_cpp.server.app:create_app --host $HOST --port $PORT
You can’t perform that action at this time.
0 commit comments