Xboard/docs/多开Xboard教程.md

51 lines
1.4 KiB
Markdown
Raw Normal View History

**本篇教程默认你已经安装了1panel并部署单个Xboard容器运行成功。**
2023-11-22 06:32:26 -05:00
1.在1panel >文件,复制 Xboard 文件夹,重命名为 Xbaord-1 ,并修改`.env`文件。
```
2023-11-22 06:32:26 -05:00
#省略
DB_CONNECTION=mysql
2023-11-22 06:32:26 -05:00
DB_HOST=mysql
DB_PORT=3306
2023-11-22 06:32:26 -05:00
DB_DATABASE=xboard1 # 新数据库
DB_USERNAME=xboard1 # 账号密码
DB_PASSWORD=root_password
2023-11-22 06:32:26 -05:00
REDIS_HOST=/run/redis-socket/redis.sock # 内置Redis不用变
REDIS_PASSWORD=null
REDIS_PORT=0
#省略
```
2023-11-22 06:32:26 -05:00
2.1panel>文件,修改 Xboard-1 默认的docker-compose.yaml
```
version: '3'
services:
2023-11-22 06:32:26 -05:00
xboard-1:
image: ghcr.io/cedar2025/xboard:latest
volumes:
- ./.env:/www/.env
- ./.docker/.data/:/www/.docker/.data/
# - ./config/v2board.php:/www/config/v2board.php
2023-11-22 06:32:26 -05:00
- redis-socket:/run/redis-socket # 挂载socket
environment:
- docker=true #用于给安装脚本判断是否为docker环境
depends_on:
- redis-1
network_mode: 1panel-network
ports:
2023-11-22 06:32:26 -05:00
- 127.0.0.1:7002:7001 #端口不要跟原来的冲突
redis-1:
build:
context: .docker/services/redis
volumes:
2023-11-22 06:32:26 -05:00
- ./.docker/.data/redis:/data/ # 挂载redis持久化数据
- redis-socket:/run/redis-socket # 挂载socket
```
启动 Xboard-1
```
docker compose up -d
```
2023-11-22 06:32:26 -05:00
3.在1panel>网站用openresty分别反代`127.0.0.1:7001` `127.0.0.1:7002` 两个站点。