File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333 ```
3434 - 修改完成后,重启 docker 服务即可
3535
36+ ## 4 如何访问 SQLBot 内置的 PG 数据库
3637
38+ !!! Abstract ""
39+ docker 命令启动的 SQLBot,可以先停止服务,加上 PG 的运行端口: -p 5432:5432
40+ ```
41+ docker run -d \
42+ --name sqlbot \
43+ --restart unless-stopped \
44+ -p 8000:8000 \
45+ -p 8001:8001 \
46+ -p 5432:5432 \
47+ -v ./data/sqlbot/excel:/opt/sqlbot/data/excel \
48+ -v ./data/sqlbot/file:/opt/sqlbot/data/file \
49+ -v ./data/sqlbot/images:/opt/sqlbot/images \
50+ -v ./data/sqlbot/logs:/opt/sqlbot/logs \
51+ -v ./data/postgresql:/var/lib/postgresql/data \
52+ --privileged=true \
53+ dataease/sqlbot
54+ ```
55+
56+ 以 docker compose 方式运行(离线包或 docker-compose 命令)的 SQLBot,可以修改 docker-compose.yml 文件,将 PG 的运行端口暴露出来,如下面示例代码中的 「5432:5432」。
57+
58+ 若服务器 5432 端口已被占用,可以将冒号前的端口修改为其他可用端口,保持冒号后 PG 的内部端口 5432 不变即可。修改完 docker-compose.yml 文件后,请重新启动 SQLBot 服务。
59+
60+ ```yml
61+ services:
62+ sqlbot:
63+ image: registry.cn-qingdao.aliyuncs.com/dataease/sqlbot
64+ container_name: sqlbot
65+ restart: always
66+ privileged: true
67+ networks:
68+ - sqlbot-network
69+ ports:
70+ - ${SQLBOT_WEB_PORT}:8000
71+ - ${SQLBOT_MCP_PORT}:8001
72+ - 5432:5432
73+ env_file:
74+ - conf/sqlbot.conf
75+ volumes:
76+ - ./data/sqlbot/excel:/opt/sqlbot/data/excel
77+ - ./data/sqlbot/file:/opt/sqlbot/data/file
78+ - ./data/sqlbot/images:/opt/sqlbot/images
79+ - ./data/sqlbot/logs:/opt/sqlbot/app/logs
80+ - ./data/postgresql:/var/lib/postgresql/data
81+
82+ networks:
83+ sqlbot-network:
84+ ```
85+
86+ 默认 PG 的访问信息如下:
87+ ```
88+ POSTGRES_PORT=5432
89+ POSTGRES_DB=sqlbot
90+ POSTGRES_USER=root
91+ POSTGRES_PASSWORD=Password123@pg
92+ ```
You can’t perform that action at this time.
0 commit comments