feat: add docker deployment

This commit is contained in:
Yoilun
2026-05-25 22:41:12 +08:00
parent 8c1093a53c
commit 4262191462
9 changed files with 225 additions and 4 deletions

View File

@@ -38,6 +38,55 @@ pnpm dev
打开 `http://127.0.0.1:13083/` 查看工作台。
## Docker 启动
构建镜像:
```bash
docker build -t codex-agent-manager:local .
```
启动容器,并把本机 Codex 配置和当前项目目录挂载进去:
```bash
docker run --rm \
--name codex-agent-manager \
-p 0.0.0.0:18083:18083 \
-e CODEX_HOME=/codex-home \
-e WORKSPACE_ROOT=/Users/yoilun/Code/codex-agent-manager \
-v /Users/yoilun/.codex:/codex-home \
-v /Users/yoilun/Code/codex-agent-manager:/Users/yoilun/Code/codex-agent-manager:ro \
codex-agent-manager:local
```
然后打开 `http://127.0.0.1:18083/`。Docker 镜像内由 Go 后端同时提供 API 和前端静态页面,不需要再单独启动 Vite。
如果要让局域网内其他设备访问,保持上面的 `0.0.0.0:18083:18083` 端口映射,然后在同一局域网的设备上打开:
```text
http://你的电脑局域网IP:18083/
```
在 macOS 上可用下面命令查看当前 Wi-Fi/LAN IP
```bash
ipconfig getifaddr en0
```
也可以使用 Compose
```bash
docker compose up --build
```
如需改挂载路径,可在启动前设置本机环境变量:
```bash
CODEX_HOME=/path/to/.codex \
CODEX_AGENT_MANAGER_PROJECT=/path/to/codex-agent-manager \
docker compose up --build
```
## 验证命令
后端和整体检查: