Update the README to include Docker Compose usage instructions

This commit is contained in:
hkfires
2025-09-04 10:00:56 +08:00
parent f1d6f01585
commit f38b78dbe6
3 changed files with 53 additions and 0 deletions

View File

@@ -486,6 +486,31 @@ Run the following command to start the server:
docker run --rm -p 8317:8317 -v /path/to/your/config.yaml:/CLIProxyAPI/config.yaml -v /path/to/your/auth-dir:/root/.cli-proxy-api eceasy/cli-proxy-api:latest docker run --rm -p 8317:8317 -v /path/to/your/config.yaml:/CLIProxyAPI/config.yaml -v /path/to/your/auth-dir:/root/.cli-proxy-api eceasy/cli-proxy-api:latest
``` ```
## Run with Docker Compose
1. Create a `config.yaml` from `config.example.yaml` and customize it.
2. Build and start the services using Docker Compose:
```bash
docker compose up -d --build
```
3. To authenticate with providers, run the login command inside the container:
- **Gemini**: `docker compose exec cli-proxy-api /CLIProxyAPI/CLIProxyAPI -no-browser --login`
- **OpenAI (Codex)**: `docker compose exec cli-proxy-api /CLIProxyAPI/CLIProxyAPI -no-browser --codex-login`
- **Claude**: `docker compose exec cli-proxy-api /CLIProxyAPI/CLIProxyAPI -no-browser --claude-login`
- **Qwen**: `docker compose exec cli-proxy-api /CLIProxyAPI/CLIProxyAPI -no-browser --qwen-login`
4. To view the server logs:
```bash
docker compose logs -f
```
5. To stop the application:
```bash
docker compose down
```
## Management API ## Management API
see [MANAGEMENT_API.md](MANAGEMENT_API.md) see [MANAGEMENT_API.md](MANAGEMENT_API.md)

View File

@@ -499,6 +499,31 @@ docker run -it -rm -v /path/to/your/config.yaml:/CLIProxyAPI/config.yaml -v /pat
docker run --rm -p 8317:8317 -v /path/to/your/config.yaml:/CLIProxyAPI/config.yaml -v /path/to/your/auth-dir:/root/.cli-proxy-api eceasy/cli-proxy-api:latest docker run --rm -p 8317:8317 -v /path/to/your/config.yaml:/CLIProxyAPI/config.yaml -v /path/to/your/auth-dir:/root/.cli-proxy-api eceasy/cli-proxy-api:latest
``` ```
## 使用 Docker Compose 运行
1. 从 `config.example.yaml` 创建一个 `config.yaml` 文件并进行自定义。
2. 使用 Docker Compose 构建并启动服务:
```bash
docker compose up -d --build
```
3. 要在容器内运行登录命令进行身份验证:
- **Gemini**: `docker compose exec cli-proxy-api /CLIProxyAPI/CLIProxyAPI -no-browser --login`
- **OpenAI (Codex)**: `docker compose exec cli-proxy-api /CLIProxyAPI/CLIProxyAPI -no-browser --codex-login`
- **Claude**: `docker compose exec cli-proxy-api /CLIProxyAPI/CLIProxyAPI -no-browser --claude-login`
- **Qwen**: `docker compose exec cli-proxy-api /CLIProxyAPI/CLIProxyAPI -no-browser --qwen-login`
4. 查看服务器日志:
```bash
docker compose logs -f
```
5. 停止应用程序:
```bash
docker compose down
```
## 管理 API 文档 ## 管理 API 文档
请参见 [MANAGEMENT_API_CN.md](MANAGEMENT_API_CN.md) 请参见 [MANAGEMENT_API_CN.md](MANAGEMENT_API_CN.md)

View File

@@ -7,6 +7,9 @@ services:
container_name: cli-proxy-api container_name: cli-proxy-api
ports: ports:
- "8317:8317" - "8317:8317"
- "8085:8085"
- "1455:1455"
- "54545:54545"
volumes: volumes:
- ./config.yaml:/CLIProxyAPI/config.yaml - ./config.yaml:/CLIProxyAPI/config.yaml
- ./auths:/root/.cli-proxy-api - ./auths:/root/.cli-proxy-api