Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
黄南光
/
mcp_hive
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e24af39c
authored
Sep 14, 2026
by
黄南光
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化项目
1 parent
a81ae80e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletions
.env.example
.gitignore
start.sh
.env.example
View file @
e24af39
...
@@ -31,3 +31,6 @@ CONSOLE_PASSWORD=123456
...
@@ -31,3 +31,6 @@ CONSOLE_PASSWORD=123456
# 会话 cookie 的签名密钥。留空则每次启动随机生成,重启后所有人要重新登录。
# 会话 cookie 的签名密钥。留空则每次启动随机生成,重启后所有人要重新登录。
# 生成一个:python -c "import secrets; print(secrets.token_urlsafe(32))"
# 生成一个:python -c "import secrets; print(secrets.token_urlsafe(32))"
SESSION_SECRET=
SESSION_SECRET=
# DNS 配置
UPSTREAM_DNS=192.168.3.194
.gitignore
View file @
e24af39
...
@@ -6,6 +6,8 @@
...
@@ -6,6 +6,8 @@
# 运行期产物
# 运行期产物
logs/
logs/
.codegraph/
.codegraph/
# start.sh 自动生成的容器 DNS override,本地部署专属
docker-compose.override.yml
# Python
# Python
__pycache__/
__pycache__/
...
...
start.sh
View file @
e24af39
...
@@ -34,11 +34,31 @@ for key in DB_HOST DB_NAME DB_USER DB_PASSWORD; do
...
@@ -34,11 +34,31 @@ for key in DB_HOST DB_NAME DB_USER DB_PASSWORD; do
done
done
echo
"==> 配置:
$ENV_FILE
"
echo
"==> 配置:
$ENV_FILE
"
# 容器默认 DNS 会解析上游域名到不可达的公网 IP(宿主机走内网 DNS,容器不继承),
# 这里生成一个 override 把容器 DNS 钉到内网解析器。地址取 .env 的 UPSTREAM_DNS,
# 没配就用测试环境这台。override 是本地部署专属、不进仓库,docker-compose.yml 不动。
UPSTREAM_DNS
=
"
$(
grep -E
"^UPSTREAM_DNS="
"
$ENV_FILE
"
| head -1 | cut -d
=
-f2- | tr -d
'\r'
| tr -d
'[:space:]'
)
"
UPSTREAM_DNS
=
"
${
UPSTREAM_DNS
:-
192
.168.3.194
}
"
echo
"==> 容器 DNS:
$UPSTREAM_DNS
(生成 docker-compose.override.yml)"
cat > docker-compose.override.yml
<<EOF
# 本文件由 start.sh 自动生成,请勿手工编辑、也不要提交。
# 作用:把容器 DNS 钉到内网解析器,否则上游域名会解析到不可达的公网 IP。
services:
mcp-host:
dns:
- ${UPSTREAM_DNS}
gateway:
dns:
- ${UPSTREAM_DNS}
EOF
echo
"==> 构建镜像"
echo
"==> 构建镜像"
$DC
build
$DC
build
echo
"==> 启动容器"
echo
"==> 启动容器"
$DC
up -d
# DNS 变了要让 compose 重建容器才生效,force-recreate 保证不吃旧的
$DC
up -d --force-recreate
echo
"==> 等待健康检查"
echo
"==> 等待健康检查"
for
_
in
$(
seq 1 30
)
;
do
for
_
in
$(
seq 1 30
)
;
do
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment