xykj-plus/claude-ecc/dev-assistant/bridge/docker-compose.example.yml
2026-06-13 13:48:51 +08:00

104 lines
2.1 KiB
YAML
Raw Permalink 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.

# Dev-Assistant Bridge 示例部署配置
# 用于演示如何将 AI 助手集成到你的项目中
services:
# 你的应用服务示例Java Spring Boot 服务)
app:
image: your-app:latest
ports:
- "8080:8080"
volumes:
- ./app:/app/logs:/logs
environment:
- LOG_DIR: /app/logs
# AI Bridge 服务
bridge:
image: dev-assistant/dev-assistant-bridge:1.0.0
ports:
- "9020:9020"
volumes:
- ./your-project:/your-project:/workspace # 挂载你的项目代码
- ./bridge-data:/data # 数据目录持久化
- ./dev-assistant.yaml:/app/config/dev-assistant.yaml # 挂载配置文件
environment:
- DEV_ASSISTANT_WORKSPACE_ROOT=/your-project
- BRIDGE_AUTH_VERIFY_URL=http://app:8080/api/auth/me
# 可选:如果你的应用使用不同端口
- BRIDGE_ORIGIN=http://localhost:8080
# 可选:如果你的前端使用不同域
depends_on:
- app
volumes:
bridge-data:
driver: local
driver_opts:
type: none
# 数据目录挂载到宿主机,重启后数据持久化
```
# 使用说明
## 1. 启动服务
```bash
docker compose up -d docker-compose.yml
```
## 2. 访问应用
打开浏览器访问http://localhost:8080
## 3. 访问 AI 助手
打开浏览器访问http://localhost:9001
登录后点击右侧 "AI 助手" 按钮
## 4. 查看日志
```bash
docker logs -f dev-assistant-bridge
```
## 配置文件
将以下内容保存为 `./dev-assistant.yaml` 并挂载到容器:
```yaml
bridge:
port: 9020
host: 0.0.0.0
workspace:
root: ./your-project
allowWrite:
- your-project/**
- your-project/src/**
denyWrite:
- .env*
- target/**
logs:
- id: app
label: 你的应用日志
path: /app/logs/app.log
format: logback-json
tailLines: 500
project:
name: 你的应用
techStack:
- Java 21
- Spring Boot 3
conventions:
- RESTful API
systemPrompt: "你是 ${project.name} 的开发助手..."
bridge:
auth:
type: http
verifyUrl: http://app:8080/api/auth/me
requiredRole: ADMIN
context:
maxPromptTokens: 16000
cacheDir: .cache
```