Enhance Docker configuration and update dependencies for Realtime Agent Studio

- Updated Dockerfile for the API to include build tools for C++11 required for native extensions.
- Revised requirements.txt to upgrade several dependencies, including FastAPI and SQLAlchemy.
- Expanded docker-compose.yml to add MinIO service for S3-compatible storage and improved health checks for backend and engine services.
- Enhanced README.md in the Docker directory to provide detailed service descriptions and quick start instructions.
- Updated mkdocs.yml to reflect new navigation structure and added deployment overview documentation.
- Introduced new Dockerfiles for the engine and web services, including development configurations for hot reloading.
This commit is contained in:
Xin Wang
2026-03-04 10:01:00 +08:00
parent 4c05131536
commit 530d95eea4
20 changed files with 318 additions and 332 deletions

View File

@@ -1 +1,78 @@
# Docker Deployment
# Docker Deployment
This folder contains Docker Compose configuration to run the entire AI VideoAssistant stack.
## Services
| Service | Port | Description |
|---------|------|-------------|
| minio | 9000, 9001 | S3-compatible object storage |
| backend | 8100 | FastAPI backend API |
| engine | 8001 | Conversation engine (WebSocket) |
| frontend | 6000 | React web application |
## Prerequisites
1. Docker and Docker Compose installed
2. The `engine/data/vad/silero_vad.onnx` VAD model file must exist
3. Agent configuration in `engine/config/agents/default.yaml`
## Quick Start
```bash
cd docker
docker compose up -d
```
## Access Points
- **Frontend**: http://localhost:6000
- **Backend API**: http://localhost:8100
- **Engine WebSocket**: ws://localhost:8001/ws
- **MinIO Console**: http://localhost:9001 (admin / password123)
## Configuration
### Engine Environment Variables
The engine service uses environment variables for configuration. Key variables:
- `BACKEND_URL`: Backend API URL (default: `http://backend:8100`)
- `LOG_LEVEL`: Logging level (default: `INFO`)
- `CORS_ORIGINS`: Allowed CORS origins
Agent-specific settings (LLM, TTS, ASR) are configured via YAML files in `engine/config/agents/`.
### Volumes
- `minio_data`: MinIO storage data
- `backend_data`: Backend SQLite database
- `engine_logs`: Engine log files
## Development Mode
To mount source code for hot-reload during development:
```bash
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d
```
## Logs
```bash
# View all logs
docker compose logs -f
# View specific service logs
docker compose logs -f engine
docker compose logs -f backend
```
## Stopping
```bash
docker compose down
# Remove volumes as well
docker compose down -v
```

View File

@@ -1,11 +1,35 @@
version: '3.8'
# Project name used as prefix for containers, volumes, and networks
name: ras
# Docker registry mirror for China users (change to empty or "docker.io" if you have direct access)
x-registry-mirror: &registry-mirror docker.1ms.run
services:
# 后端 API
# MinIO (S3 compatible storage)
minio:
image: ${REGISTRY_MIRROR:-docker.1ms.run}/minio/minio
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio_data:/data
environment:
MINIO_ROOT_USER: admin
MINIO_ROOT_PASSWORD: password123
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 5s
timeout: 5s
retries: 5
# Backend API
backend:
build:
context: ../api
dockerfile: Dockerfile
args:
REGISTRY_MIRROR: ${REGISTRY_MIRROR:-docker.1ms.run}
ports:
- "8100:8100"
environment:
@@ -15,12 +39,18 @@ services:
- MINIO_SECRET_KEY=password123
- MINIO_BUCKET=ai-audio
volumes:
- ../api:/app
- ../api/data:/app/data
- backend_data:/app/data
depends_on:
- minio
minio:
condition: service_started
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8100/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
# 对话引擎 (py-active-call)
# Conversation Engine
engine:
build:
context: ../engine
@@ -28,31 +58,64 @@ services:
ports:
- "8001:8001"
environment:
- HOST=0.0.0.0
- PORT=8001
- BACKEND_MODE=http
- BACKEND_URL=http://backend:8100
- LOG_LEVEL=INFO
- CORS_ORIGINS=["http://localhost:6000","http://localhost:3000"]
volumes:
- ../engine/config:/app/config:ro
- ../engine/data:/app/data:ro
- engine_logs:/app/logs
depends_on:
- backend
backend:
condition: service_started
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
# 前端 (Vite + React)
# Frontend (Vite + React) production: built static files served on 6000
frontend:
build:
context: ../web
dockerfile: Dockerfile
args:
- VITE_API_BASE_URL=http://localhost:8100/api
REGISTRY_MIRROR: ${REGISTRY_MIRROR:-docker.1ms.run}
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-http://localhost:8100/api}
VITE_ENGINE_WS_URL: ${VITE_ENGINE_WS_URL:-ws://localhost:8001/ws}
ports:
- "6000:6000"
depends_on:
- backend
- engine
# MinIO (S3 兼容存储)
minio:
image: minio/minio
# Frontend dev hot reload on port 3000 (run with: docker compose --profile dev up)
frontend-dev:
profiles:
- dev
build:
context: ../web
dockerfile: Dockerfile.dev
args:
REGISTRY_MIRROR: ${REGISTRY_MIRROR:-docker.1ms.run}
ports:
- "9000:9000"
- "9001:9001"
volumes:
- ./storage/minio/data:/data
- "3000:3000"
environment:
MINIO_ROOT_USER: admin
MINIO_ROOT_PASSWORD: password123
command: server /data --console-address ":9001"
- VITE_API_BASE_URL=${VITE_API_BASE_URL:-http://localhost:8100/api}
- VITE_ENGINE_WS_URL=${VITE_ENGINE_WS_URL:-ws://localhost:8001/ws}
volumes:
- ../web:/app
- frontend_dev_node_modules:/app/node_modules
depends_on:
- backend
- engine
volumes:
minio_data:
backend_data:
engine_logs:
frontend_dev_node_modules: