Files
beaver_project/deploy-control/README.md
steven_li be30aa9465 feat(deploy-control): 使用uv包管理器替换Python基础镜像
- 将Dockerfile的基础镜像从python:3.11-slim更换为ghcr.io/astral-sh/uv:python3.11-bookworm-slim
- 添加pyproject.toml和uv.lock文件到容器中
- 使用uv sync命令进行依赖安装
- 将启动命令从"python /app/server.py"改为"uv run --frozen server.py"
- 更新README.md中的启动命令说明,使用uv run替代python3运行服务
2026-03-16 10:23:43 +08:00

50 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# deploy-control
部署机接口:
-`auth-portal` 提供实例创建和实例解析 API
- 调用 `app-instance/create-instance.sh`
- 在实例创建后刷新 `router-proxy`
## 接口
- `GET /healthz`
- `POST /api/instances/register`
- `POST /api/instances/resolve`
- `DELETE /api/instances/{instance_id}`
## 关键环境变量
- `DEPLOY_CONTROL_API_TOKEN`
- `APP_INSTANCE_API_KEY`
- `DEFAULT_AUTHZ_BASE_URL`
- `DEPLOY_PUBLIC_BASE_DOMAIN`
- `DEPLOY_PUBLIC_PORT`
- `DEPLOY_PUBLIC_SCHEME`
- `APP_INSTANCE_NETWORK_NAME`
默认实例 URL 形如:
```text
http://<instance-slug>.127.0.0.1.nip.io:8088
```
实例容器本身的 `20000-29999` 端口默认只绑定到部署机 `127.0.0.1`,外部入口应走 `router-proxy`
## 本机启动
```bash
cd /home/ivan/xuan/nano_project/deploy-control
uv run server.py
```
## Docker 启动
如果要容器化运行,需要挂载:
- Docker socket`/var/run/docker.sock`
- `/home/ivan/xuan/nano_project/app-instance`
- `/home/ivan/xuan/nano_project/router-proxy`
并传入对应环境变量,让容器内脚本路径仍能访问这两个目录。