mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-30 04:15:45 +08:00
53 lines
1.6 KiB
Plaintext
53 lines
1.6 KiB
Plaintext
---
|
|
title: "Docker部署"
|
|
description: "在 Windows、Linux 或 macOS 上使用 Docker Compose 部署 LangBot。"
|
|
---
|
|
|
|
## 1. 准备环境
|
|
|
|
- 安装 Git。
|
|
- **Windows / macOS**:安装并启动 Docker Desktop。
|
|
- **Linux**:安装 Docker 和 Docker Compose。
|
|
|
|
## 2. 下载项目
|
|
|
|
请选择有写入权限的普通目录。Linux 用户请避开 `/root`、`/etc` 等系统目录,建议放在 `/opt` 下,以免沙箱功能被安全规则拦截。
|
|
|
|
在准备存放项目的目录打开终端(Windows 可用 PowerShell),逐行执行:
|
|
|
|
```bash
|
|
git clone https://github.com/langbot-app/LangBot
|
|
cd LangBot/docker
|
|
```
|
|
|
|
### 中国大陆用户:启动前更换镜像源(可选)
|
|
|
|
如果 Docker Hub 下载较慢,先编辑 `LangBot/docker/docker-compose.yaml`,将文件中的所有 `rockchin/langbot:latest` 替换为:
|
|
|
|
```text
|
|
docker.langbot.app/langbot-public/rockchin/langbot:latest
|
|
```
|
|
|
|
保存后再启动,无需更改其他配置。
|
|
|
|
## 3. 启动 LangBot
|
|
|
|
<Note>
|
|
如果部署在服务器上,请通过防火墙限制管理页面和运行时端口的访问,仅允许可信来源连接。
|
|
</Note>
|
|
|
|
在刚才的终端中执行:
|
|
|
|
```bash
|
|
docker compose --profile all up -d
|
|
```
|
|
|
|
首次启动需要下载镜像。Windows / macOS 用户请保持 Docker Desktop 运行。
|
|
|
|
## 4. 打开管理页面
|
|
|
|
- **本机部署**:打开 `http://localhost:5300`。
|
|
- **服务器部署**:打开 `http://你的服务器IP:5300`,确保防火墙允许你的设备访问该端口。
|
|
|
|
按照页面提示完成初始化,再添加[模型](/zh/usage/models/readme)和[机器人](/zh/usage/platforms/readme)。
|