feat: add docker deployment
This commit is contained in:
49
README.md
49
README.md
@@ -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
|
||||
```
|
||||
|
||||
## 验证命令
|
||||
|
||||
后端和整体检查:
|
||||
|
||||
Reference in New Issue
Block a user