Skip to content

Commit b013fc1

Browse files
committed
fix(docker): rkllm_server_demo was refactored
1 parent d8dbb6d commit b013fc1

File tree

2 files changed

+39
-3
lines changed

2 files changed

+39
-3
lines changed

examples/rkllm_server_demo/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
FROM python:3.12-slim AS base
22

3+
RUN apt-get update \
4+
&& apt-get install -y --no-install-recommends libgomp1 \
5+
&& rm -rf /var/lib/apt/lists/*
6+
37
WORKDIR /app
48

59
COPY examples/rkllm_server_demo/rkllm_server /app
6-
COPY runtime/Linux/librkllm_api/aarch64/librkllmrt.so /app/lib
10+
COPY rkllm-runtime/Linux/librkllm_api/aarch64/librkllmrt.so /app/lib
711

812
ENV PIP_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple
913
EXPOSE 8080

examples/rkllm_server_demo/docker-compose.yaml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Usage:
2+
# 1. Download your `your-model.rkllm` model to the `./models/` directory
3+
# 2. Start the chat-api with:
4+
# RKLLM_MODEL_FILE="your-model.rkllm" docker compose run --rm -it chat-api
5+
16
services:
27
rkllm-server:
38
build:
@@ -14,10 +19,37 @@ services:
1419
ports:
1520
- ${RKLLM_SERVER_PORT:-8080}:8080
1621
volumes:
17-
- ./models:/app/models:ro # *.rkllm models
18-
- /sys:/sys:rw # for fix_freq_*.sh scripts
22+
- ./models:/app/models:ro # *.rkllm models
23+
- /sys:/sys:rw # for fix_freq_*.sh scripts
1924
devices:
2025
- /dev/dri:/dev/dri
2126
security_opt:
2227
- systempaths=unconfined
2328
restart: "no"
29+
30+
chat-api:
31+
build:
32+
dockerfile_inline: |
33+
FROM python:3.12-slim
34+
35+
RUN [ "${RKLLM_SERVER_INTERFACE:-gradio}" = "gradio" ] \
36+
&& pip install "gradio>=4.24.0"
37+
volumes:
38+
- ./:/usr/local/src/app/:ro
39+
working_dir: /app
40+
command:
41+
- "bash"
42+
- "-c"
43+
- >-
44+
>/app/chat_api.py sed "s,172.x.x.x:8080,server:8080,g"
45+
"/usr/local/src/app/chat_api_${RKLLM_SERVER_INTERFACE:-gradio}.py"
46+
&& python3 -m chat_api
47+
links:
48+
- "rkllm-server:server"
49+
ports:
50+
- ${RKLLM_CLIENT_PORT:-8888}:8080
51+
depends_on:
52+
- rkllm-server # Ensure the server starts first
53+
stdin_open: true # Keep STDIN open for interactive use
54+
tty: true # Allocate a TTY for the client
55+

0 commit comments

Comments
 (0)