feat: 新增 Docker Compose 部署支持及文档

1. 新增 docker/docker-compose.yml 文件,支持使用预构建镜像或本地源码构建。
2. 更新 README.md、README-ZH.md 和 README-JA.md,添加 Docker Compose 部署指南。
This commit is contained in:
ZqinKing 2026-01-04 20:49:10 +08:00
parent 6a8e81d7f3
commit 7d273315fb
4 changed files with 72 additions and 0 deletions

View file

@ -112,6 +112,21 @@ docker run -d -p 3000:3000 -p 8085:8085 -p 8086:8086 -p 19876-19880:19876-19880
- `-v "指定パス:/app/configs"`:設定ディレクトリをマウント(「指定パス」を実際のパスに置き換えてください、例:`/home/user/aiclient-configs`
- `--name aiclient2api`:コンテナ名
#### 🐳 Docker Compose デプロイ
Docker Compose を使用してデプロイすることもできます。まず、`docker` ディレクトリに移動します:
```bash
cd docker
mkdir -p configs
docker compose up -d
```
プリビルドイメージの代わりにソースからビルドする場合は、`docker-compose.yml` を編集してください:
1. `image: justlikemaki/aiclient-2-api:latest` 行をコメントアウト
2. `build:` セクションのコメントを解除
3. `docker compose up -d --build` を実行
#### 1. 起動スクリプトの実行
* **Linux/macOS**: `chmod +x install-and-run.sh && ./install-and-run.sh`
* **Windows**: `install-and-run.bat` をダブルクリックして実行

View file

@ -111,6 +111,21 @@ docker run -d -p 3000:3000 -p 8085:8085 -p 8086:8086 -p 19876-19880:19876-19880
- `-v "指定路径:/app/configs"`:挂载配置目录(请将"指定路径"替换为实际路径,如 `/home/user/aiclient-configs`
- `--name aiclient2api`:容器名称
#### 🐳 Docker Compose 部署
你也可以使用 Docker Compose 进行部署。首先,进入 `docker` 目录:
```bash
cd docker
mkdir -p configs
docker compose up -d
```
如需从源码构建而非使用预构建镜像,请编辑 `docker-compose.yml`
1. 注释掉 `image: justlikemaki/aiclient-2-api:latest`
2. 取消 `build:` 部分的注释
3. 运行 `docker compose up -d --build`
#### 1. 运行启动脚本
* **Linux/macOS**: `chmod +x install-and-run.sh && ./install-and-run.sh`
* **Windows**: 双击运行 `install-and-run.bat`

View file

@ -112,6 +112,21 @@ docker run -d -p 3000:3000 -p 8085:8085 -p 8086:8086 -p 19876-19880:19876-19880
- `-v "your_path:/app/configs"`: Mount configuration directory (replace "your_path" with actual path, e.g., `/home/user/aiclient-configs`)
- `--name aiclient2api`: Container name
#### 🐳 Docker Compose Deployment
You can also use Docker Compose for deployment. First, navigate to the `docker` directory:
```bash
cd docker
mkdir -p configs
docker compose up -d
```
To build from source instead of using the pre-built image, edit `docker-compose.yml`:
1. Comment out the `image: justlikemaki/aiclient-2-api:latest` line
2. Uncomment the `build:` section
3. Run `docker compose up -d --build`
#### 1. Run the startup script
* **Linux/macOS**: `chmod +x install-and-run.sh && ./install-and-run.sh`
* **Windows**: Double-click `install-and-run.bat`

27
docker/docker-compose.yml Normal file
View file

@ -0,0 +1,27 @@
services:
aiclient-api:
# 方式一:使用 Docker Hub 预构建镜像(默认,推荐)
image: justlikemaki/aiclient-2-api:latest
# 方式二:从 Dockerfile 本地构建(取消下面注释并注释掉上面的 image 行)
# build:
# context: ..
# dockerfile: Dockerfile
container_name: aiclient2api
restart: unless-stopped
ports:
- "3000:3000"
- "8085:8085"
- "8086:8086"
- "19876-19880:19876-19880"
volumes:
- ./configs:/app/configs
environment:
- ARGS=
healthcheck:
test: ["CMD", "node", "healthcheck.js"]
interval: 30s
timeout: 3s
start_period: 5s
retries: 3