@lobehub/chat 0.147.0 → 0.147.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.md +8 -8
- package/README.zh-CN.md +8 -8
- package/docs/self-hosting/advanced/analytics.mdx +1 -0
- package/docs/self-hosting/advanced/analytics.zh-CN.mdx +1 -0
- package/docs/self-hosting/advanced/authentication.mdx +7 -6
- package/docs/self-hosting/advanced/authentication.zh-CN.mdx +7 -6
- package/docs/self-hosting/advanced/sso-providers/auth0.mdx +58 -32
- package/docs/self-hosting/advanced/sso-providers/auth0.zh-CN.mdx +60 -32
- package/docs/self-hosting/advanced/sso-providers/authentik.mdx +33 -29
- package/docs/self-hosting/advanced/sso-providers/authentik.zh-CN.mdx +30 -27
- package/docs/self-hosting/advanced/sso-providers/github.mdx +49 -20
- package/docs/self-hosting/advanced/sso-providers/github.zh-CN.mdx +57 -31
- package/docs/self-hosting/advanced/sso-providers/microsoft-entra-id.mdx +53 -35
- package/docs/self-hosting/advanced/sso-providers/microsoft-entra-id.zh-CN.mdx +43 -31
- package/docs/self-hosting/advanced/sso-providers/zitadel.mdx +64 -34
- package/docs/self-hosting/advanced/sso-providers/zitadel.zh-CN.mdx +62 -36
- package/docs/self-hosting/advanced/upstream-sync.mdx +32 -23
- package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +32 -23
- package/docs/self-hosting/environment-variables/analytics.mdx +1 -0
- package/docs/self-hosting/environment-variables/analytics.zh-CN.mdx +1 -0
- package/docs/self-hosting/environment-variables/auth.mdx +1 -0
- package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +1 -0
- package/docs/self-hosting/environment-variables/basic.mdx +1 -0
- package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +1 -0
- package/docs/self-hosting/environment-variables/model-provider.mdx +1 -0
- package/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +1 -0
- package/docs/self-hosting/environment-variables.mdx +1 -0
- package/docs/self-hosting/environment-variables.zh-CN.mdx +1 -0
- package/docs/self-hosting/examples/azure-openai.mdx +12 -8
- package/docs/self-hosting/examples/azure-openai.zh-CN.mdx +12 -8
- package/docs/self-hosting/examples/ollama.mdx +1 -0
- package/docs/self-hosting/examples/ollama.zh-CN.mdx +1 -0
- package/docs/self-hosting/faq/no-v1-suffix.mdx +1 -0
- package/docs/self-hosting/faq/no-v1-suffix.zh-CN.mdx +1 -0
- package/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.mdx +1 -0
- package/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.zh-CN.mdx +1 -0
- package/docs/self-hosting/platform/docker-compose.mdx +80 -73
- package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +79 -73
- package/docs/self-hosting/platform/docker.mdx +85 -85
- package/docs/self-hosting/platform/docker.zh-CN.mdx +84 -85
- package/docs/self-hosting/platform/netlify.mdx +91 -42
- package/docs/self-hosting/platform/netlify.zh-CN.mdx +88 -38
- package/docs/self-hosting/platform/railway.mdx +8 -6
- package/docs/self-hosting/platform/railway.zh-CN.mdx +8 -6
- package/docs/self-hosting/platform/repocloud.mdx +8 -6
- package/docs/self-hosting/platform/repocloud.zh-CN.mdx +8 -6
- package/docs/self-hosting/platform/sealos.mdx +8 -6
- package/docs/self-hosting/platform/sealos.zh-CN.mdx +8 -6
- package/docs/self-hosting/platform/vercel.mdx +9 -7
- package/docs/self-hosting/platform/vercel.zh-CN.mdx +9 -7
- package/docs/self-hosting/platform/zeabur.mdx +8 -6
- package/docs/self-hosting/platform/zeabur.zh-CN.mdx +8 -6
- package/docs/self-hosting/start.mdx +11 -1
- package/docs/self-hosting/start.zh-CN.mdx +2 -1
- package/docs/usage/agents/concepts.mdx +13 -2
- package/docs/usage/agents/concepts.zh-CN.mdx +13 -2
- package/docs/usage/agents/custom-agent.mdx +9 -2
- package/docs/usage/agents/custom-agent.zh-CN.mdx +8 -4
- package/docs/usage/agents/model.mdx +3 -3
- package/docs/usage/agents/model.zh-CN.mdx +6 -5
- package/docs/usage/agents/prompt.mdx +7 -5
- package/docs/usage/agents/prompt.zh-CN.mdx +7 -5
- package/docs/usage/agents/topics.mdx +9 -1
- package/docs/usage/agents/topics.zh-CN.mdx +9 -1
- package/docs/usage/features/agent-market.mdx +5 -5
- package/docs/usage/features/agent-market.zh-CN.mdx +1 -0
- package/docs/usage/features/local-llm.mdx +6 -1
- package/docs/usage/features/local-llm.zh-CN.mdx +6 -1
- package/docs/usage/features/mobile.mdx +5 -1
- package/docs/usage/features/mobile.zh-CN.mdx +6 -1
- package/docs/usage/features/more.mdx +1 -0
- package/docs/usage/features/more.zh-CN.mdx +1 -0
- package/docs/usage/features/multi-ai-providers.mdx +11 -2
- package/docs/usage/features/multi-ai-providers.zh-CN.mdx +12 -2
- package/docs/usage/features/plugin-system.mdx +8 -7
- package/docs/usage/features/plugin-system.zh-CN.mdx +9 -7
- package/docs/usage/features/pwa.mdx +10 -4
- package/docs/usage/features/pwa.zh-CN.mdx +11 -4
- package/docs/usage/features/text-to-image.zh-CN.mdx +1 -0
- package/docs/usage/features/theme.mdx +6 -1
- package/docs/usage/features/theme.zh-CN.mdx +7 -1
- package/docs/usage/features/tts.zh-CN.mdx +1 -0
- package/docs/usage/features/vision.zh-CN.mdx +1 -0
- package/docs/usage/plugins/basic-usage.mdx +31 -7
- package/docs/usage/plugins/basic-usage.zh-CN.mdx +31 -7
- package/docs/usage/plugins/custom-plugin.mdx +1 -0
- package/docs/usage/plugins/custom-plugin.zh-CN.mdx +1 -0
- package/docs/usage/plugins/development.mdx +79 -30
- package/docs/usage/plugins/development.zh-CN.mdx +80 -31
- package/docs/usage/plugins/store.mdx +11 -2
- package/docs/usage/plugins/store.zh-CN.mdx +11 -2
- package/docs/usage/providers/groq.mdx +32 -12
- package/docs/usage/providers/groq.zh-CN.mdx +30 -12
- package/docs/usage/providers/ollama/gemma.mdx +27 -11
- package/docs/usage/providers/ollama/gemma.zh-CN.mdx +28 -11
- package/docs/usage/providers/ollama/qwen.mdx +30 -16
- package/docs/usage/providers/ollama/qwen.zh-CN.mdx +25 -11
- package/docs/usage/providers/ollama.mdx +27 -14
- package/docs/usage/providers/ollama.zh-CN.mdx +27 -14
- package/package.json +1 -1
- package/src/locales/resources.test.ts +49 -0
- package/src/locales/resources.ts +7 -20
|
@@ -11,120 +11,127 @@ tags:
|
|
|
11
11
|
- Automatic Updates
|
|
12
12
|
- Crontab Script
|
|
13
13
|
---
|
|
14
|
+
|
|
14
15
|
# Docker Compose Deployment Guide
|
|
15
16
|
|
|
16
17
|
<div style={{display:"flex", gap: 4}}>
|
|
17
18
|
[![][docker-release-shield]][docker-release-link]
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
[![][docker-size-shield]][docker-size-link]
|
|
21
|
+
|
|
22
|
+
[![][docker-pulls-shield]][docker-pulls-link]
|
|
20
23
|
|
|
21
|
-
[![][docker-pulls-shield]][docker-pulls-link]
|
|
22
24
|
</div>
|
|
23
25
|
|
|
24
26
|
We provide a [Docker image][docker-release-link] for deploying the LobeChat service on your private device.
|
|
25
27
|
|
|
26
28
|
<Steps>
|
|
27
|
-
|
|
29
|
+
|
|
30
|
+
### Install Docker Container Environment
|
|
28
31
|
|
|
29
|
-
|
|
32
|
+
(Skip this step if already installed)
|
|
30
33
|
|
|
31
|
-
|
|
32
|
-
<Tab>
|
|
33
|
-
```fish
|
|
34
|
-
$ apt install docker.io
|
|
35
|
-
```
|
|
34
|
+
<Tabs items={['Ubuntu', 'CentOS']}>
|
|
36
35
|
|
|
36
|
+
<Tab>
|
|
37
|
+
|
|
38
|
+
```fish
|
|
39
|
+
$ apt install docker.io
|
|
40
|
+
```
|
|
41
|
+
|
|
37
42
|
</Tab>
|
|
38
43
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
<Tab>
|
|
45
|
+
|
|
46
|
+
```fish
|
|
47
|
+
$ yum install docker
|
|
48
|
+
```
|
|
49
|
+
|
|
44
50
|
</Tab>
|
|
45
|
-
|
|
51
|
+
|
|
46
52
|
</Tabs>
|
|
47
53
|
|
|
48
|
-
|
|
54
|
+
### Run Docker Compose Deployment Command
|
|
49
55
|
|
|
50
|
-
|
|
56
|
+
When using `docker-compose`, the configuration file is as follows:
|
|
51
57
|
|
|
52
|
-
|
|
53
|
-
|
|
58
|
+
```yml
|
|
59
|
+
version: '3.8'
|
|
54
60
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
services:
|
|
62
|
+
lobe-chat:
|
|
63
|
+
image: lobehub/lobe-chat
|
|
64
|
+
container_name: lobe-chat
|
|
65
|
+
restart: always
|
|
66
|
+
ports:
|
|
67
|
+
- '3210:3210'
|
|
68
|
+
environment:
|
|
69
|
+
OPENAI_API_KEY: sk-xxxx
|
|
70
|
+
OPENAI_PROXY_URL: https://api-proxy.com/v1
|
|
71
|
+
ACCESS_CODE: lobe66
|
|
72
|
+
```
|
|
67
73
|
|
|
68
|
-
|
|
74
|
+
Run the following command to start the Lobe Chat service:
|
|
69
75
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
76
|
+
```bash
|
|
77
|
+
$ docker-compose up -d
|
|
78
|
+
```
|
|
73
79
|
|
|
74
|
-
|
|
80
|
+
### Crontab Automatic Update Script (Optional)
|
|
75
81
|
|
|
76
|
-
|
|
82
|
+
Similarly, you can use the following script to automatically update Lobe Chat. When using `Docker Compose`, no additional configuration of environment variables is required.
|
|
77
83
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
84
|
+
```bash
|
|
85
|
+
#!/bin/bash
|
|
86
|
+
# auto-update-lobe-chat.sh
|
|
81
87
|
|
|
82
|
-
|
|
83
|
-
|
|
88
|
+
# Set proxy (optional)
|
|
89
|
+
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
|
|
84
90
|
|
|
85
|
-
|
|
86
|
-
|
|
91
|
+
# Pull the latest image and store the output in a variable
|
|
92
|
+
output=$(docker pull lobehub/lobe-chat:latest 2>&1)
|
|
87
93
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
94
|
+
# Check if the pull command was executed successfully
|
|
95
|
+
if [ $? -ne 0 ]; then
|
|
96
|
+
exit 1
|
|
97
|
+
fi
|
|
92
98
|
|
|
93
|
-
|
|
94
|
-
|
|
99
|
+
# Check if the output contains a specific string
|
|
100
|
+
echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest"
|
|
95
101
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
102
|
+
# If the image is already up to date, do nothing
|
|
103
|
+
if [ $? -eq 0 ]; then
|
|
104
|
+
exit 0
|
|
105
|
+
fi
|
|
100
106
|
|
|
101
|
-
|
|
107
|
+
echo "Detected Lobe-Chat update"
|
|
102
108
|
|
|
103
|
-
|
|
104
|
-
|
|
109
|
+
# Remove the old container
|
|
110
|
+
echo "Removed: $(docker rm -f Lobe-Chat)"
|
|
105
111
|
|
|
106
|
-
|
|
107
|
-
|
|
112
|
+
# You may need to navigate to the directory where `docker-compose.yml` is located first
|
|
113
|
+
# cd /path/to/docker-compose-folder
|
|
108
114
|
|
|
109
|
-
|
|
110
|
-
|
|
115
|
+
# Run the new container
|
|
116
|
+
echo "Started: $(docker-compose up)"
|
|
111
117
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
118
|
+
# Print the update time and version
|
|
119
|
+
echo "Update time: $(date)"
|
|
120
|
+
echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')"
|
|
115
121
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
122
|
+
# Clean up unused images
|
|
123
|
+
docker images | grep 'lobehub/lobe-chat' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1
|
|
124
|
+
echo "Removed old images."
|
|
125
|
+
```
|
|
120
126
|
|
|
121
|
-
|
|
127
|
+
This script can also be used in Crontab, but ensure that your Crontab can find the correct Docker command. It is recommended to use absolute paths.
|
|
122
128
|
|
|
123
|
-
|
|
129
|
+
Configure Crontab to execute the script every 5 minutes:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
*/5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1
|
|
133
|
+
```
|
|
124
134
|
|
|
125
|
-
```bash
|
|
126
|
-
*/5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1
|
|
127
|
-
```
|
|
128
135
|
</Steps>
|
|
129
136
|
|
|
130
137
|
[docker-pulls-link]: https://hub.docker.com/r/lobehub/lobe-chat
|
|
@@ -8,14 +8,16 @@ tags:
|
|
|
8
8
|
- 自动更新脚本
|
|
9
9
|
- 部署指引
|
|
10
10
|
---
|
|
11
|
+
|
|
11
12
|
# Docker Compose 部署指引
|
|
12
13
|
|
|
13
14
|
<div style={{display:"flex", gap: 4}}>
|
|
14
15
|
[![][docker-release-shield]][docker-release-link]
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
[![][docker-size-shield]][docker-size-link]
|
|
18
|
+
|
|
19
|
+
[![][docker-pulls-shield]][docker-pulls-link]
|
|
17
20
|
|
|
18
|
-
[![][docker-pulls-shield]][docker-pulls-link]
|
|
19
21
|
</div>
|
|
20
22
|
|
|
21
23
|
我们提供了 [Docker 镜像][docker-release-link],供你在自己的私有设备上部署 LobeChat 服务。
|
|
@@ -23,105 +25,109 @@ tags:
|
|
|
23
25
|
<Steps>
|
|
24
26
|
### 安装 Docker 容器环境
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
(如果已安装,请跳过此步)
|
|
29
|
+
|
|
30
|
+
<Tabs items={['Ubuntu', 'CentOS']}>
|
|
31
|
+
|
|
32
|
+
<Tab>
|
|
33
|
+
|
|
34
|
+
```fish
|
|
35
|
+
$ apt install docker.io
|
|
36
|
+
```
|
|
27
37
|
|
|
28
|
-
<Tabs items={['Ubuntu', 'CentOS']}>
|
|
29
|
-
<Tab>
|
|
30
|
-
```fish
|
|
31
|
-
$ apt install docker.io
|
|
32
|
-
```
|
|
33
|
-
|
|
34
38
|
</Tab>
|
|
35
39
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
<Tab>
|
|
41
|
+
|
|
42
|
+
```fish
|
|
43
|
+
$ yum install docker
|
|
44
|
+
```
|
|
45
|
+
|
|
41
46
|
</Tab>
|
|
42
|
-
|
|
47
|
+
|
|
43
48
|
</Tabs>
|
|
44
49
|
|
|
45
|
-
|
|
50
|
+
### 运行 Docker Compose 部署指令
|
|
51
|
+
|
|
52
|
+
使用 `docker-compose` 时配置文件如下:
|
|
46
53
|
|
|
47
|
-
|
|
54
|
+
```yml
|
|
55
|
+
version: '3.8'
|
|
48
56
|
|
|
49
|
-
|
|
50
|
-
|
|
57
|
+
services:
|
|
58
|
+
lobe-chat:
|
|
59
|
+
image: lobehub/lobe-chat
|
|
60
|
+
container_name: lobe-chat
|
|
61
|
+
restart: always
|
|
62
|
+
ports:
|
|
63
|
+
- '3210:3210'
|
|
64
|
+
environment:
|
|
65
|
+
OPENAI_API_KEY: sk-xxxx
|
|
66
|
+
OPENAI_PROXY_URL: https://api-proxy.com/v1
|
|
67
|
+
ACCESS_CODE: lobe66
|
|
68
|
+
```
|
|
51
69
|
|
|
52
|
-
|
|
53
|
-
lobe-chat:
|
|
54
|
-
image: lobehub/lobe-chat
|
|
55
|
-
container_name: lobe-chat
|
|
56
|
-
restart: always
|
|
57
|
-
ports:
|
|
58
|
-
- '3210:3210'
|
|
59
|
-
environment:
|
|
60
|
-
OPENAI_API_KEY: sk-xxxx
|
|
61
|
-
OPENAI_PROXY_URL: https://api-proxy.com/v1
|
|
62
|
-
ACCESS_CODE: lobe66
|
|
63
|
-
```
|
|
70
|
+
运行以下命令启动 Lobe Chat 服务:
|
|
64
71
|
|
|
65
|
-
|
|
72
|
+
```bash
|
|
73
|
+
$ docker-compose up -d
|
|
74
|
+
```
|
|
66
75
|
|
|
67
|
-
|
|
68
|
-
$ docker-compose up -d
|
|
69
|
-
```
|
|
76
|
+
### Crontab 自动更新脚本(可选)
|
|
70
77
|
|
|
71
|
-
|
|
78
|
+
类似地,你可以使用以下脚本来自动更新 Lobe Chat,使用 `Docker Compose` 时,环境变量无需额外配置。
|
|
72
79
|
|
|
73
|
-
|
|
80
|
+
```bash
|
|
81
|
+
#!/bin/bash
|
|
82
|
+
# auto-update-lobe-chat.sh
|
|
74
83
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
# auto-update-lobe-chat.sh
|
|
84
|
+
# 设置代理(可选)
|
|
85
|
+
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
|
|
78
86
|
|
|
79
|
-
|
|
80
|
-
|
|
87
|
+
# 拉取最新的镜像并将输出存储在变量中
|
|
88
|
+
output=$(docker pull lobehub/lobe-chat:latest 2>&1)
|
|
81
89
|
|
|
82
|
-
|
|
83
|
-
|
|
90
|
+
# 检查拉取命令是否成功执行
|
|
91
|
+
if [ $? -ne 0 ]; then
|
|
92
|
+
exit 1
|
|
93
|
+
fi
|
|
84
94
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
exit 1
|
|
88
|
-
fi
|
|
95
|
+
# 检查输出中是否包含特定的字符串
|
|
96
|
+
echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest"
|
|
89
97
|
|
|
90
|
-
|
|
91
|
-
|
|
98
|
+
# 如果镜像已经是最新的,则不执行任何操作
|
|
99
|
+
if [ $? -eq 0 ]; then
|
|
100
|
+
exit 0
|
|
101
|
+
fi
|
|
92
102
|
|
|
93
|
-
|
|
94
|
-
if [ $? -eq 0 ]; then
|
|
95
|
-
exit 0
|
|
96
|
-
fi
|
|
103
|
+
echo "Detected Lobe-Chat update"
|
|
97
104
|
|
|
98
|
-
|
|
105
|
+
# 删除旧的容器
|
|
106
|
+
echo "Removed: $(docker rm -f Lobe-Chat)"
|
|
99
107
|
|
|
100
|
-
|
|
101
|
-
|
|
108
|
+
# 也许需要先进入 `docker-compose.yml` 所在的目录
|
|
109
|
+
# cd /path/to/docker-compose-folder
|
|
102
110
|
|
|
103
|
-
|
|
104
|
-
|
|
111
|
+
# 运行新的容器
|
|
112
|
+
echo "Started: $(docker-compose up)"
|
|
105
113
|
|
|
106
|
-
|
|
107
|
-
|
|
114
|
+
# 打印更新的时间和版本
|
|
115
|
+
echo "Update time: $(date)"
|
|
116
|
+
echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')"
|
|
108
117
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
118
|
+
# 清理不再使用的镜像
|
|
119
|
+
docker images | grep 'lobehub/lobe-chat' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1
|
|
120
|
+
echo "Removed old images."
|
|
121
|
+
```
|
|
112
122
|
|
|
113
|
-
|
|
114
|
-
docker images | grep 'lobehub/lobe-chat' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1
|
|
115
|
-
echo "Removed old images."
|
|
116
|
-
```
|
|
123
|
+
此脚本亦可以在 Crontab 中使用,但请确认你的 Crontab 可以找到正确的 Docker 命令。建议使用绝对路径。
|
|
117
124
|
|
|
118
|
-
|
|
125
|
+
配置 Crontab,每 5 分钟执行一次脚本:
|
|
119
126
|
|
|
120
|
-
|
|
127
|
+
```bash
|
|
128
|
+
*/5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1
|
|
129
|
+
```
|
|
121
130
|
|
|
122
|
-
```bash
|
|
123
|
-
*/5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1
|
|
124
|
-
```
|
|
125
131
|
</Steps>
|
|
126
132
|
|
|
127
133
|
[docker-pulls-link]: https://hub.docker.com/r/lobehub/lobe-chat
|
|
@@ -10,14 +10,16 @@ tags:
|
|
|
10
10
|
- Proxy Configuration
|
|
11
11
|
- Automatic Update Script
|
|
12
12
|
---
|
|
13
|
+
|
|
13
14
|
# Docker Deployment Guide
|
|
14
15
|
|
|
15
16
|
<div style={{display:"flex", gap: 4}}>
|
|
16
17
|
[![][docker-release-shield]][docker-release-link]
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
[![][docker-size-shield]][docker-size-link]
|
|
20
|
+
|
|
21
|
+
[![][docker-pulls-shield]][docker-pulls-link]
|
|
19
22
|
|
|
20
|
-
[![][docker-pulls-shield]][docker-pulls-link]
|
|
21
23
|
</div>
|
|
22
24
|
|
|
23
25
|
We provide a [Docker image][docker-release-link] for you to deploy the LobeChat service on your private device.
|
|
@@ -25,7 +27,7 @@ We provide a [Docker image][docker-release-link] for you to deploy the LobeChat
|
|
|
25
27
|
<Steps>
|
|
26
28
|
### Install Docker Container Environment
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
(If already installed, skip this step)
|
|
29
31
|
|
|
30
32
|
<Tabs items={['Ubuntu', 'CentOS']}>
|
|
31
33
|
<Tab>
|
|
@@ -39,126 +41,124 @@ We provide a [Docker image][docker-release-link] for you to deploy the LobeChat
|
|
|
39
41
|
```fish
|
|
40
42
|
$ yum install docker
|
|
41
43
|
```
|
|
42
|
-
|
|
44
|
+
|
|
43
45
|
</Tab>
|
|
44
46
|
|
|
45
47
|
</Tabs>
|
|
46
48
|
|
|
47
|
-
|
|
49
|
+
### Docker Command Deployment
|
|
48
50
|
|
|
49
|
-
|
|
51
|
+
Use the following command to start the LobeChat service with one click:
|
|
50
52
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
```fish
|
|
54
|
+
$ docker run -d -p 3210:3210 \
|
|
55
|
+
-e OPENAI_API_KEY=sk-xxxx \
|
|
56
|
+
-e ACCESS_CODE=lobe66 \
|
|
57
|
+
--name lobe-chat \
|
|
58
|
+
lobehub/lobe-chat
|
|
59
|
+
```
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
Command explanation:
|
|
60
62
|
|
|
61
|
-
|
|
63
|
+
- The default port mapping is `3210`, please ensure it is not occupied or manually change the port mapping.
|
|
62
64
|
|
|
63
|
-
|
|
65
|
+
- Replace `sk-xxxx` in the above command with your OpenAI API Key.
|
|
64
66
|
|
|
65
|
-
|
|
67
|
+
- For the complete list of environment variables supported by LobeChat, please refer to the [Environment Variables](/zh/self-hosting/environment-ariable) section.
|
|
66
68
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
<Callout type="tip">
|
|
70
|
+
Since the official Docker image build takes about half an hour, if you see the "update available"
|
|
71
|
+
prompt after deployment, you can wait for the image to finish building before deploying again.
|
|
71
72
|
</Callout>
|
|
72
73
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
<Callout type="warning">
|
|
75
|
+
The official Docker image does not have a password set. It is strongly recommended to add a
|
|
76
|
+
password to enhance security, otherwise you may encounter situations like [My API Key was
|
|
77
|
+
stolen!!!](https://github.com/lobehub/lobe-chat/issues/1123).
|
|
78
78
|
</Callout>
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
<Callout type="important">
|
|
81
|
+
Note that when the **deployment architecture is inconsistent with the image**, you need to
|
|
82
|
+
cross-compile **Sharp**, see [Sharp
|
|
83
|
+
Cross-Compilation](https://sharp.pixelplumbing.com/install#cross-platform) for details.
|
|
85
84
|
</Callout>
|
|
86
85
|
|
|
87
|
-
|
|
86
|
+
#### Using a Proxy Address
|
|
87
|
+
|
|
88
|
+
If you need to use the OpenAI service through a proxy, you can configure the proxy address using the `OPENAI_PROXY_URL` environment variable:
|
|
88
89
|
|
|
89
|
-
|
|
90
|
+
```fish
|
|
91
|
+
$ docker run -d -p 3210:3210 \
|
|
92
|
+
-e OPENAI_API_KEY=sk-xxxx \
|
|
93
|
+
-e OPENAI_PROXY_URL=https://api-proxy.com/v1 \
|
|
94
|
+
-e ACCESS_CODE=lobe66 \
|
|
95
|
+
--name lobe-chat \
|
|
96
|
+
lobehub/lobe-chat
|
|
97
|
+
```
|
|
90
98
|
|
|
91
|
-
|
|
92
|
-
$ docker run -d -p 3210:3210 \
|
|
93
|
-
-e OPENAI_API_KEY=sk-xxxx \
|
|
94
|
-
-e OPENAI_PROXY_URL=https://api-proxy.com/v1 \
|
|
95
|
-
-e ACCESS_CODE=lobe66 \
|
|
96
|
-
--name lobe-chat \
|
|
97
|
-
lobehub/lobe-chat
|
|
98
|
-
```
|
|
99
|
+
### Crontab Automatic Update Script (Optional)
|
|
99
100
|
|
|
100
|
-
|
|
101
|
+
If you want to automatically obtain the latest image, you can follow these steps.
|
|
101
102
|
|
|
102
|
-
|
|
103
|
+
First, create a `lobe.env` configuration file with various environment variables, for example:
|
|
103
104
|
|
|
104
|
-
|
|
105
|
+
```env
|
|
106
|
+
OPENAI_API_KEY=sk-xxxx
|
|
107
|
+
OPENAI_PROXY_URL=https://api-proxy.com/v1
|
|
108
|
+
ACCESS_CODE=arthals2333
|
|
109
|
+
CUSTOM_MODELS=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4-0125-preview=gpt-4-turbo,gpt-4-vision-preview=gpt-4-vision
|
|
110
|
+
```
|
|
105
111
|
|
|
106
|
-
|
|
107
|
-
OPENAI_API_KEY=sk-xxxx
|
|
108
|
-
OPENAI_PROXY_URL=https://api-proxy.com/v1
|
|
109
|
-
ACCESS_CODE=arthals2333
|
|
110
|
-
CUSTOM_MODELS=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4-0125-preview=gpt-4-turbo,gpt-4-vision-preview=gpt-4-vision
|
|
111
|
-
```
|
|
112
|
+
Then, you can use the following script to automate the update:
|
|
112
113
|
|
|
113
|
-
|
|
114
|
+
```bash
|
|
115
|
+
#!/bin/bash
|
|
116
|
+
# auto-update-lobe-chat.sh
|
|
114
117
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
# auto-update-lobe-chat.sh
|
|
118
|
+
# Set up proxy (optional)
|
|
119
|
+
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
|
|
118
120
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
+
# Pull the latest image and store the output in a variable
|
|
122
|
+
output=$(docker pull lobehub/lobe-chat:latest 2>&1)
|
|
121
123
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
# Check if the pull command was executed successfully
|
|
125
|
+
if [ $? -ne 0 ]; then
|
|
126
|
+
exit 1
|
|
127
|
+
fi
|
|
124
128
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
exit 1
|
|
128
|
-
fi
|
|
129
|
+
# Check if the output contains a specific string
|
|
130
|
+
echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest"
|
|
129
131
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
+
# If the image is already up to date, do nothing
|
|
133
|
+
if [ $? -eq 0 ]; then
|
|
134
|
+
exit 0
|
|
135
|
+
fi
|
|
132
136
|
|
|
133
|
-
|
|
134
|
-
if [ $? -eq 0 ]; then
|
|
135
|
-
exit 0
|
|
136
|
-
fi
|
|
137
|
+
echo "Detected Lobe-Chat update"
|
|
137
138
|
|
|
138
|
-
|
|
139
|
+
# Remove the old container
|
|
140
|
+
echo "Removed: $(docker rm -f Lobe-Chat)"
|
|
139
141
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
+
# Run the new container
|
|
143
|
+
echo "Started: $(docker run -d --network=host --env-file /path/to/lobe.env --name=Lobe-Chat --restart=always lobehub/lobe-chat)"
|
|
142
144
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
+
# Print the update time and version
|
|
146
|
+
echo "Update time: $(date)"
|
|
147
|
+
echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')"
|
|
145
148
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
+
# Clean up unused images
|
|
150
|
+
docker images | grep 'lobehub/lobe-chat' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1
|
|
151
|
+
echo "Removed old images."
|
|
152
|
+
```
|
|
149
153
|
|
|
150
|
-
|
|
151
|
-
docker images | grep 'lobehub/lobe-chat' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1
|
|
152
|
-
echo "Removed old images."
|
|
153
|
-
```
|
|
154
|
+
This script can be used in Crontab, but please ensure that your Crontab can find the correct Docker command. It is recommended to use absolute paths.
|
|
154
155
|
|
|
155
|
-
|
|
156
|
+
Configure Crontab to execute the script every 5 minutes:
|
|
156
157
|
|
|
157
|
-
|
|
158
|
+
```bash
|
|
159
|
+
*/5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1
|
|
160
|
+
```
|
|
158
161
|
|
|
159
|
-
```bash
|
|
160
|
-
*/5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1
|
|
161
|
-
```
|
|
162
162
|
</Steps>
|
|
163
163
|
|
|
164
164
|
[docker-pulls-link]: https://hub.docker.com/r/lobehub/lobe-chat
|