mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-25 17:54:34 +08:00
fix(docker): persist CLI system state
This commit is contained in:
1 parent
383f0ec749
commit
a0712f0b3a
4 files changed
+23
-23
No files matched your search
@@ -15,13 +15,13 @@ ghcr.io/chatlab/chatlab-cli
|
||||
```bash
|
||||
docker run --name chatlab \
|
||||
-p 127.0.0.1:3110:3110 \
|
||||
-v chatlab-data:/data \
|
||||
-v chatlab-data:/home/node/.chatlab \
|
||||
ghcr.io/chatlab/chatlab-cli:latest
|
||||
```
|
||||
|
||||
容器启动后,打开 <http://127.0.0.1:3110/>。
|
||||
|
||||
镜像使用非特权 `node` 用户运行,并将 ChatLab 数据保存在 `/data`。替换或升级容器时,请保留该数据卷。
|
||||
镜像使用非特权 `node` 用户运行。该数据卷会保留 `/home/node/.chatlab` 下的系统状态和用户数据。替换或升级容器时,请保留该数据卷。
|
||||
|
||||
## 服务选项
|
||||
|
||||
@@ -48,7 +48,7 @@ Docker 参数会替换完整的默认命令。添加服务选项时,需要按
|
||||
```bash
|
||||
docker run --rm \
|
||||
-p 8080:8080 \
|
||||
-v chatlab-data:/data \
|
||||
-v chatlab-data:/home/node/.chatlab \
|
||||
ghcr.io/chatlab/chatlab-cli:latest \
|
||||
start --port 8080 --host 0.0.0.0 --headless --no-open
|
||||
```
|
||||
@@ -58,7 +58,7 @@ docker run --rm \
|
||||
```bash
|
||||
docker run --rm ghcr.io/chatlab/chatlab-cli:latest --version
|
||||
docker run --rm ghcr.io/chatlab/chatlab-cli:latest formats
|
||||
docker run --rm -v chatlab-data:/data \
|
||||
docker run --rm -v chatlab-data:/home/node/.chatlab \
|
||||
ghcr.io/chatlab/chatlab-cli:latest sessions --format json
|
||||
```
|
||||
|
||||
@@ -74,7 +74,7 @@ docker run --rm -v chatlab-data:/data \
|
||||
|
||||
| 环境变量 | 说明 |
|
||||
| --- | --- |
|
||||
| `CHATLAB_DATA_DIR` | 覆盖 ChatLab 数据目录;镜像将其设置为 `/data`。 |
|
||||
| `CHATLAB_DATA_DIR` | 覆盖 ChatLab 用户数据目录。设置后,请另外挂载所选目录。 |
|
||||
| `CHATLAB_API_PORT` | 设置 `api.port`。`start` 命令会提供自身的默认值,因此请使用 `--port` 配置容器服务。 |
|
||||
| `CHATLAB_API_HOST` | 设置 `api.host`。`start` 命令会提供自身的默认值,因此请使用 `--host` 配置容器服务。 |
|
||||
| `CHATLAB_LLM_PROVIDER` | 设置 `llm.provider`。 |
|
||||
@@ -106,7 +106,7 @@ services:
|
||||
ports:
|
||||
- "3110:3110"
|
||||
volumes:
|
||||
- chatlab-data:/data
|
||||
- chatlab-data:/home/node/.chatlab
|
||||
command:
|
||||
- start
|
||||
- --port
|
||||
|
||||
@@ -16,14 +16,15 @@ ghcr.io/chatlab/chatlab-cli
|
||||
```bash
|
||||
docker run --name chatlab \
|
||||
-p 127.0.0.1:3110:3110 \
|
||||
-v chatlab-data:/data \
|
||||
-v chatlab-data:/home/node/.chatlab \
|
||||
ghcr.io/chatlab/chatlab-cli:latest
|
||||
```
|
||||
|
||||
Open <http://127.0.0.1:3110/> after the container starts.
|
||||
|
||||
The image runs as the unprivileged `node` user and stores ChatLab data in
|
||||
`/data`. Keep the volume when replacing or upgrading the container.
|
||||
The image runs as the unprivileged `node` user. The volume preserves system
|
||||
state and user data under `/home/node/.chatlab`. Keep it when replacing or
|
||||
upgrading the container.
|
||||
|
||||
## Server options
|
||||
|
||||
@@ -51,7 +52,7 @@ Docker arguments replace the complete default command. Repeat `start`,
|
||||
```bash
|
||||
docker run --rm \
|
||||
-p 8080:8080 \
|
||||
-v chatlab-data:/data \
|
||||
-v chatlab-data:/home/node/.chatlab \
|
||||
ghcr.io/chatlab/chatlab-cli:latest \
|
||||
start --port 8080 --host 0.0.0.0 --headless --no-open
|
||||
```
|
||||
@@ -61,7 +62,7 @@ Other CLI commands can be selected directly:
|
||||
```bash
|
||||
docker run --rm ghcr.io/chatlab/chatlab-cli:latest --version
|
||||
docker run --rm ghcr.io/chatlab/chatlab-cli:latest formats
|
||||
docker run --rm -v chatlab-data:/data \
|
||||
docker run --rm -v chatlab-data:/home/node/.chatlab \
|
||||
ghcr.io/chatlab/chatlab-cli:latest sessions --format json
|
||||
```
|
||||
|
||||
@@ -78,7 +79,7 @@ The configuration environment variables, in source declaration order, are:
|
||||
|
||||
| Variable | Description |
|
||||
| --- | --- |
|
||||
| `CHATLAB_DATA_DIR` | Override the ChatLab data directory. The image sets it to `/data`. |
|
||||
| `CHATLAB_DATA_DIR` | Override the ChatLab user data directory. When set, mount the selected directory separately. |
|
||||
| `CHATLAB_API_PORT` | Set `api.port`. The `start` command supplies its own default, so use `--port` to configure the container server. |
|
||||
| `CHATLAB_API_HOST` | Set `api.host`. The `start` command supplies its own default, so use `--host` to configure the container server. |
|
||||
| `CHATLAB_LLM_PROVIDER` | Set `llm.provider`. |
|
||||
@@ -112,7 +113,7 @@ services:
|
||||
ports:
|
||||
- "3110:3110"
|
||||
volumes:
|
||||
- chatlab-data:/data
|
||||
- chatlab-data:/home/node/.chatlab
|
||||
command:
|
||||
- start
|
||||
- --port
|
||||
|
||||
@@ -15,13 +15,13 @@ ghcr.io/chatlab/chatlab-cli
|
||||
```bash
|
||||
docker run --name chatlab \
|
||||
-p 127.0.0.1:3110:3110 \
|
||||
-v chatlab-data:/data \
|
||||
-v chatlab-data:/home/node/.chatlab \
|
||||
ghcr.io/chatlab/chatlab-cli:latest
|
||||
```
|
||||
|
||||
容器啟動後,開啟 <http://127.0.0.1:3110/>。
|
||||
|
||||
映像使用非特權 `node` 使用者執行,並將 ChatLab 資料儲存在 `/data`。替換或升級容器時,請保留此資料卷。
|
||||
映像使用非特權 `node` 使用者執行。此資料卷會保留 `/home/node/.chatlab` 下的系統狀態與使用者資料。替換或升級容器時,請保留此資料卷。
|
||||
|
||||
## 服務選項
|
||||
|
||||
@@ -48,7 +48,7 @@ Docker 參數會替換完整的預設命令。加入服務選項時,需要視
|
||||
```bash
|
||||
docker run --rm \
|
||||
-p 8080:8080 \
|
||||
-v chatlab-data:/data \
|
||||
-v chatlab-data:/home/node/.chatlab \
|
||||
ghcr.io/chatlab/chatlab-cli:latest \
|
||||
start --port 8080 --host 0.0.0.0 --headless --no-open
|
||||
```
|
||||
@@ -58,7 +58,7 @@ docker run --rm \
|
||||
```bash
|
||||
docker run --rm ghcr.io/chatlab/chatlab-cli:latest --version
|
||||
docker run --rm ghcr.io/chatlab/chatlab-cli:latest formats
|
||||
docker run --rm -v chatlab-data:/data \
|
||||
docker run --rm -v chatlab-data:/home/node/.chatlab \
|
||||
ghcr.io/chatlab/chatlab-cli:latest sessions --format json
|
||||
```
|
||||
|
||||
@@ -74,7 +74,7 @@ docker run --rm -v chatlab-data:/data \
|
||||
|
||||
| 環境變數 | 說明 |
|
||||
| --- | --- |
|
||||
| `CHATLAB_DATA_DIR` | 覆寫 ChatLab 資料目錄;映像將其設定為 `/data`。 |
|
||||
| `CHATLAB_DATA_DIR` | 覆寫 ChatLab 使用者資料目錄。設定後,請另外掛載所選目錄。 |
|
||||
| `CHATLAB_API_PORT` | 設定 `api.port`。`start` 命令會提供自己的預設值,因此請使用 `--port` 設定容器服務。 |
|
||||
| `CHATLAB_API_HOST` | 設定 `api.host`。`start` 命令會提供自己的預設值,因此請使用 `--host` 設定容器服務。 |
|
||||
| `CHATLAB_LLM_PROVIDER` | 設定 `llm.provider`。 |
|
||||
@@ -106,7 +106,7 @@ services:
|
||||
ports:
|
||||
- "3110:3110"
|
||||
volumes:
|
||||
- chatlab-data:/data
|
||||
- chatlab-data:/home/node/.chatlab
|
||||
command:
|
||||
- start
|
||||
- --port
|
||||
|
||||
Reference in new issue
Block a user