mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
feat: remove useless file && docker file
This commit is contained in:
parent
a66deddc57
commit
59c711acae
8 changed files with 16 additions and 729 deletions
|
|
@ -11,9 +11,7 @@ services:
|
|||
env_file:
|
||||
- .env
|
||||
depends_on:
|
||||
xiaozhi-esp32-server-db:
|
||||
condition: service_healthy
|
||||
xiaozhi-esp32-server-redis:
|
||||
live-agent-api:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
|
|
@ -73,7 +71,7 @@ services:
|
|||
- /home/ubuntu/live-agent/main/xiaozhi-server/music:/opt/xiaozhi-esp32-server/music
|
||||
# Logs (optional, for debugging)
|
||||
- /home/ubuntu/live-agent/main/xiaozhi-server/logs:/opt/xiaozhi-esp32-server/logs
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# live-agent-api Dependencies: Postgres + Minio
|
||||
# ============================================================================
|
||||
|
|
@ -140,6 +138,11 @@ services:
|
|||
condition: service_healthy
|
||||
live-agent-minio:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
# ============================================================================
|
||||
# Networks
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@ services:
|
|||
env_file:
|
||||
- .env
|
||||
depends_on:
|
||||
xiaozhi-esp32-server-db:
|
||||
condition: service_healthy
|
||||
xiaozhi-esp32-server-redis:
|
||||
live-agent-api:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
|
|
@ -110,6 +108,11 @@ services:
|
|||
condition: service_healthy
|
||||
live-agent-minio:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
# ============================================================================
|
||||
# Networks
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@ FROM python:3.12-slim
|
|||
|
||||
WORKDIR /app
|
||||
|
||||
# Install curl for healthcheck
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install uv
|
||||
RUN pip install uv
|
||||
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
# Docker安装Server
|
||||
|
||||
version: '3'
|
||||
services:
|
||||
xiaozhi-esp32-server:
|
||||
image: ghcr.nju.edu.cn/xinnan-tech/xiaozhi-esp32-server:server_latest
|
||||
container_name: xiaozhi-esp32-server
|
||||
restart: always
|
||||
security_opt:
|
||||
- seccomp:unconfined
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
ports:
|
||||
# ws服务端
|
||||
- "8000:8000"
|
||||
# http服务的端口,用于简单OTA接口(单服务部署),以及视觉分析接口
|
||||
- "8003:8003"
|
||||
volumes:
|
||||
# 配置文件目录
|
||||
- ./data:/opt/xiaozhi-esp32-server/data
|
||||
# 模型文件挂接,很重要
|
||||
- ./models/SenseVoiceSmall/model.pt:/opt/xiaozhi-esp32-server/models/SenseVoiceSmall/model.pt
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
# Docker安装全模块
|
||||
|
||||
version: '3'
|
||||
services:
|
||||
# Server模块
|
||||
xiaozhi-esp32-server:
|
||||
image: ghcr.nju.edu.cn/xinnan-tech/xiaozhi-esp32-server:server_latest
|
||||
container_name: xiaozhi-esp32-server
|
||||
depends_on:
|
||||
- xiaozhi-esp32-server-db
|
||||
- xiaozhi-esp32-server-redis
|
||||
restart: always
|
||||
networks:
|
||||
- default
|
||||
ports:
|
||||
# ws服务端
|
||||
- "8000:8000"
|
||||
# http服务的端口,用于视觉分析接口
|
||||
- "8003:8003"
|
||||
security_opt:
|
||||
- seccomp:unconfined
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
volumes:
|
||||
# 配置文件目录
|
||||
- ./data:/opt/xiaozhi-esp32-server/data
|
||||
# 模型文件挂接,很重要
|
||||
- ./models/SenseVoiceSmall/model.pt:/opt/xiaozhi-esp32-server/models/SenseVoiceSmall/model.pt
|
||||
|
||||
# manager-api和manager-web模块
|
||||
xiaozhi-esp32-server-web:
|
||||
image: ghcr.nju.edu.cn/xinnan-tech/xiaozhi-esp32-server:web_latest
|
||||
container_name: xiaozhi-esp32-server-web
|
||||
restart: always
|
||||
networks:
|
||||
- default
|
||||
depends_on:
|
||||
xiaozhi-esp32-server-db:
|
||||
condition: service_healthy
|
||||
xiaozhi-esp32-server-redis:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
# 智控台
|
||||
- "8002:8002"
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- SPRING_DATASOURCE_DRUID_URL=jdbc:mysql://xiaozhi-esp32-server-db:3306/xiaozhi_esp32_server?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&connectTimeout=30000&socketTimeout=30000&autoReconnect=true&failOverReadOnly=false&maxReconnects=10
|
||||
- SPRING_DATASOURCE_DRUID_USERNAME=root
|
||||
- SPRING_DATASOURCE_DRUID_PASSWORD=123456
|
||||
- SPRING_DATA_REDIS_HOST=xiaozhi-esp32-server-redis
|
||||
- SPRING_DATA_REDIS_PASSWORD=
|
||||
- SPRING_DATA_REDIS_PORT=6379
|
||||
volumes:
|
||||
# 配置文件目录
|
||||
- ./uploadfile:/uploadfile
|
||||
# 数据库模块
|
||||
xiaozhi-esp32-server-db:
|
||||
image: mysql:latest
|
||||
container_name: xiaozhi-esp32-server-db
|
||||
healthcheck:
|
||||
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
|
||||
timeout: 45s
|
||||
interval: 10s
|
||||
retries: 10
|
||||
restart: always
|
||||
networks:
|
||||
- default
|
||||
expose:
|
||||
- 3306
|
||||
volumes:
|
||||
- ./mysql/data:/var/lib/mysql
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- MYSQL_ROOT_PASSWORD=123456
|
||||
- MYSQL_DATABASE=xiaozhi_esp32_server
|
||||
- MYSQL_INITDB_ARGS="--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci"
|
||||
# redis模块
|
||||
xiaozhi-esp32-server-redis:
|
||||
image: redis
|
||||
expose:
|
||||
- 6379
|
||||
container_name: xiaozhi-esp32-server-redis
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
networks:
|
||||
- default
|
||||
networks:
|
||||
default:
|
||||
|
|
@ -1,246 +0,0 @@
|
|||
# Docker Compose configuration for local development
|
||||
# This file uses locally built images instead of pulling from remote registry
|
||||
|
||||
services:
|
||||
# ============================================================================
|
||||
# xiaozhi-server (Python WebSocket Server)
|
||||
# ============================================================================
|
||||
xiaozhi-esp32-server:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: xiaozhi-esp32-server:local
|
||||
container_name: xiaozhi-esp32-server
|
||||
depends_on:
|
||||
xiaozhi-esp32-server-db:
|
||||
condition: service_healthy
|
||||
xiaozhi-esp32-server-redis:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- xiaozhi-network
|
||||
ports:
|
||||
# WebSocket server
|
||||
- "8000:8000"
|
||||
# HTTP server for vision analysis and OTA
|
||||
- "8003:8003"
|
||||
security_opt:
|
||||
- seccomp:unconfined
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- PYTHONUNBUFFERED=1
|
||||
- LOG_LEVEL=INFO
|
||||
- REGION=LOCAL
|
||||
healthcheck:
|
||||
disable: true
|
||||
volumes:
|
||||
# Configuration directory
|
||||
- ./data:/opt/xiaozhi-esp32-server/data
|
||||
# Custom config (optional override, uncomment if you need to customize)
|
||||
- ./custom_config.yaml:/opt/xiaozhi-esp32-server/custom_config.yaml
|
||||
# Model files (important!)
|
||||
- ./models/SenseVoiceSmall:/opt/xiaozhi-esp32-server/models/SenseVoiceSmall
|
||||
- ./models/snakers4_silero-vad:/opt/xiaozhi-esp32-server/models/snakers4_silero-vad
|
||||
# Temporary files
|
||||
- ./tmp:/opt/xiaozhi-esp32-server/tmp
|
||||
# Music files (optional)
|
||||
- ./music:/opt/xiaozhi-esp32-server/music
|
||||
# Logs (optional, for debugging)
|
||||
- ./logs:/opt/xiaozhi-esp32-server/logs
|
||||
|
||||
# ============================================================================
|
||||
# manager-web (Management Console + API)
|
||||
# ============================================================================
|
||||
xiaozhi-esp32-server-web:
|
||||
# Build from local source (supports ARM64/Apple Silicon)
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: Dockerfile-web
|
||||
image: xiaozhi-esp32-server-web:local
|
||||
|
||||
# Option: Use pre-built image from registry (x86 only)
|
||||
# image: ghcr.nju.edu.cn/xinnan-tech/xiaozhi-esp32-server:web_latest
|
||||
# platform: linux/amd64 # Uncomment to force x86 emulation on ARM64
|
||||
|
||||
container_name: xiaozhi-esp32-server-web
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- xiaozhi-network
|
||||
depends_on:
|
||||
xiaozhi-esp32-server-db:
|
||||
condition: service_healthy
|
||||
xiaozhi-esp32-server-redis:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
# Management console and API
|
||||
- "8002:8002"
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- SPRING_PROFILES_ACTIVE=dev
|
||||
# Database connection
|
||||
- SPRING_DATASOURCE_DRUID_URL=jdbc:mysql://xiaozhi-esp32-server-db:3306/xiaozhi_esp32_server?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&connectTimeout=30000&socketTimeout=30000&autoReconnect=true&failOverReadOnly=false&maxReconnects=10
|
||||
- SPRING_DATASOURCE_DRUID_USERNAME=root
|
||||
- SPRING_DATASOURCE_DRUID_PASSWORD=123456
|
||||
# Redis connection
|
||||
- SPRING_DATA_REDIS_HOST=xiaozhi-esp32-server-redis
|
||||
- SPRING_DATA_REDIS_PORT=6379
|
||||
- SPRING_DATA_REDIS_PASSWORD=
|
||||
volumes:
|
||||
# Upload files directory
|
||||
- ./uploadfile:/uploadfile
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
# ============================================================================
|
||||
# MySQL Database
|
||||
# ============================================================================
|
||||
xiaozhi-esp32-server-db:
|
||||
image: mysql:8.0
|
||||
container_name: xiaozhi-esp32-server-db
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- xiaozhi-network
|
||||
ports:
|
||||
# Expose MySQL port for local debugging (optional)
|
||||
- "3307:3306"
|
||||
volumes:
|
||||
# Persistent database storage
|
||||
- ./mysql/data:/var/lib/mysql
|
||||
# MySQL configuration (optional)
|
||||
# - ./mysql/conf:/etc/mysql/conf.d
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- MYSQL_ROOT_PASSWORD=123456
|
||||
- MYSQL_DATABASE=xiaozhi_esp32_server
|
||||
- MYSQL_INITDB_ARGS=--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
||||
command:
|
||||
- --character-set-server=utf8mb4
|
||||
- --collation-server=utf8mb4_unicode_ci
|
||||
- --default-authentication-plugin=mysql_native_password
|
||||
- --max_connections=1000
|
||||
- --max_allowed_packet=256M
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p123456"]
|
||||
timeout: 45s
|
||||
interval: 10s
|
||||
retries: 10
|
||||
start_period: 60s
|
||||
|
||||
# ============================================================================
|
||||
# Redis Cache
|
||||
# ============================================================================
|
||||
xiaozhi-esp32-server-redis:
|
||||
image: redis:7-alpine
|
||||
container_name: xiaozhi-esp32-server-redis
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- xiaozhi-network
|
||||
ports:
|
||||
# Expose Redis port for local debugging (optional)
|
||||
- "6380:6379"
|
||||
volumes:
|
||||
# Persistent Redis data (optional)
|
||||
- ./redis/data:/data
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
command: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "5m"
|
||||
max-file: "3"
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
|
||||
# ============================================================================
|
||||
# live-agent-api Services
|
||||
# ============================================================================
|
||||
|
||||
live-agent-postgres:
|
||||
image: postgres:16-alpine
|
||||
container_name: live-agent-postgres
|
||||
environment:
|
||||
POSTGRES_DB: live_agent
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- ../live-agent-api/data/postgres:/var/lib/postgresql/data
|
||||
- ../live-agent-api/init_db.sql:/docker-entrypoint-initdb.d/init_db.sql
|
||||
networks:
|
||||
- xiaozhi-network
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
live-agent-minio:
|
||||
image: minio/minio:latest
|
||||
container_name: live-agent-minio
|
||||
command: server /data --console-address ":9001"
|
||||
environment:
|
||||
MINIO_ROOT_USER: minioadmin
|
||||
MINIO_ROOT_PASSWORD: minioadmin
|
||||
ports:
|
||||
- "19000:9000"
|
||||
- "19001:9001"
|
||||
volumes:
|
||||
- ../live-agent-api/data/minio:/data
|
||||
networks:
|
||||
- xiaozhi-network
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
live-agent-api:
|
||||
build:
|
||||
context: ../live-agent-api
|
||||
dockerfile: Dockerfile
|
||||
container_name: live-agent-api
|
||||
env_file:
|
||||
- ../live-agent-api/.env
|
||||
environment:
|
||||
DATABASE_URL: postgresql+asyncpg://postgres:postgres@live-agent-postgres:5432/live_agent
|
||||
S3_ENDPOINT_URL: http://live-agent-minio:9000
|
||||
DEBUG: "True"
|
||||
ports:
|
||||
- "8080:8080"
|
||||
networks:
|
||||
- xiaozhi-network
|
||||
depends_on:
|
||||
live-agent-postgres:
|
||||
condition: service_healthy
|
||||
live-agent-minio:
|
||||
condition: service_healthy
|
||||
|
||||
# ============================================================================
|
||||
# Networks
|
||||
# ============================================================================
|
||||
networks:
|
||||
xiaozhi-network:
|
||||
driver: bridge
|
||||
name: xiaozhi-network
|
||||
|
||||
# ============================================================================
|
||||
# Volumes (optional - for named volumes instead of bind mounts)
|
||||
# ============================================================================
|
||||
# volumes:
|
||||
# mysql-data:
|
||||
# redis-data:
|
||||
|
||||
|
|
@ -1,181 +0,0 @@
|
|||
# Docker Compose configuration for local development
|
||||
# This file uses locally built images instead of pulling from remote registry
|
||||
|
||||
services:
|
||||
# ============================================================================
|
||||
# xiaozhi-server (Python WebSocket Server)
|
||||
# ============================================================================
|
||||
xiaozhi-esp32-server:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: xiaozhi-esp32-server:local
|
||||
container_name: xiaozhi-esp32-server
|
||||
depends_on:
|
||||
xiaozhi-esp32-server-db:
|
||||
condition: service_healthy
|
||||
xiaozhi-esp32-server-redis:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- xiaozhi-network
|
||||
ports:
|
||||
# WebSocket server
|
||||
- "8000:8000"
|
||||
# HTTP server for vision analysis and OTA
|
||||
- "8003:8003"
|
||||
security_opt:
|
||||
- seccomp:unconfined
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- PYTHONUNBUFFERED=1
|
||||
- LOG_LEVEL=INFO
|
||||
- REGION=SINGAPORE
|
||||
healthcheck:
|
||||
disable: true
|
||||
volumes:
|
||||
# Configuration directory
|
||||
- ./data:/opt/xiaozhi-esp32-server/data
|
||||
# Custom config (optional override, uncomment if you need to customize)
|
||||
- ./custom_config.yaml:/opt/xiaozhi-esp32-server/custom_config.yaml
|
||||
# Model files (important!)
|
||||
- ./models/SenseVoiceSmall:/opt/xiaozhi-esp32-server/models/SenseVoiceSmall
|
||||
- ./models/snakers4_silero-vad:/opt/xiaozhi-esp32-server/models/snakers4_silero-vad
|
||||
# Temporary files
|
||||
- ./tmp:/opt/xiaozhi-esp32-server/tmp
|
||||
# Music files (optional)
|
||||
- ./music:/opt/xiaozhi-esp32-server/music
|
||||
# Logs (optional, for debugging)
|
||||
- ./logs:/opt/xiaozhi-esp32-server/logs
|
||||
|
||||
# ============================================================================
|
||||
# manager-web (Management Console + API)
|
||||
# ============================================================================
|
||||
xiaozhi-esp32-server-web:
|
||||
# Build from local source (supports ARM64/Apple Silicon)
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: Dockerfile-web
|
||||
image: xiaozhi-esp32-server-web:local
|
||||
|
||||
# Option: Use pre-built image from registry (x86 only)
|
||||
# image: ghcr.nju.edu.cn/xinnan-tech/xiaozhi-esp32-server:web_latest
|
||||
# platform: linux/amd64 # Uncomment to force x86 emulation on ARM64
|
||||
|
||||
container_name: xiaozhi-esp32-server-web
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- xiaozhi-network
|
||||
depends_on:
|
||||
xiaozhi-esp32-server-db:
|
||||
condition: service_healthy
|
||||
xiaozhi-esp32-server-redis:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
# Management console and API
|
||||
- "8002:8002"
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- SPRING_PROFILES_ACTIVE=dev
|
||||
# Database connection
|
||||
- SPRING_DATASOURCE_DRUID_URL=jdbc:mysql://xiaozhi-esp32-server-db:3306/xiaozhi_esp32_server?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&connectTimeout=30000&socketTimeout=30000&autoReconnect=true&failOverReadOnly=false&maxReconnects=10
|
||||
- SPRING_DATASOURCE_DRUID_USERNAME=root
|
||||
- SPRING_DATASOURCE_DRUID_PASSWORD=123456
|
||||
# Redis connection
|
||||
- SPRING_DATA_REDIS_HOST=xiaozhi-esp32-server-redis
|
||||
- SPRING_DATA_REDIS_PORT=6379
|
||||
- SPRING_DATA_REDIS_PASSWORD=
|
||||
volumes:
|
||||
# Upload files directory
|
||||
- ./uploadfile:/uploadfile
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
# ============================================================================
|
||||
# MySQL Database
|
||||
# ============================================================================
|
||||
xiaozhi-esp32-server-db:
|
||||
image: mysql:8.0
|
||||
container_name: xiaozhi-esp32-server-db
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- xiaozhi-network
|
||||
ports:
|
||||
# Expose MySQL port for local debugging (optional)
|
||||
- "3307:3306"
|
||||
volumes:
|
||||
# Persistent database storage
|
||||
- ./mysql/data:/var/lib/mysql
|
||||
# MySQL configuration (optional)
|
||||
# - ./mysql/conf:/etc/mysql/conf.d
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- MYSQL_ROOT_PASSWORD=123456
|
||||
- MYSQL_DATABASE=xiaozhi_esp32_server
|
||||
- MYSQL_INITDB_ARGS=--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
||||
command:
|
||||
- --character-set-server=utf8mb4
|
||||
- --collation-server=utf8mb4_unicode_ci
|
||||
- --default-authentication-plugin=mysql_native_password
|
||||
- --max_connections=1000
|
||||
- --max_allowed_packet=256M
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p123456"]
|
||||
timeout: 45s
|
||||
interval: 10s
|
||||
retries: 10
|
||||
start_period: 60s
|
||||
|
||||
# ============================================================================
|
||||
# Redis Cache
|
||||
# ============================================================================
|
||||
xiaozhi-esp32-server-redis:
|
||||
image: redis:7-alpine
|
||||
container_name: xiaozhi-esp32-server-redis
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- xiaozhi-network
|
||||
ports:
|
||||
# Expose Redis port for local debugging (optional)
|
||||
- "6380:6379"
|
||||
volumes:
|
||||
# Persistent Redis data (optional)
|
||||
- ./redis/data:/data
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
command: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "5m"
|
||||
max-file: "3"
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
|
||||
# ============================================================================
|
||||
# Networks
|
||||
# ============================================================================
|
||||
networks:
|
||||
xiaozhi-network:
|
||||
driver: bridge
|
||||
name: xiaozhi-network
|
||||
|
||||
# ============================================================================
|
||||
# Volumes (optional - for named volumes instead of bind mounts)
|
||||
# ============================================================================
|
||||
# volumes:
|
||||
# mysql-data:
|
||||
# redis-data:
|
||||
|
||||
|
|
@ -1,181 +0,0 @@
|
|||
# Docker Compose configuration for local development
|
||||
# This file uses locally built images instead of pulling from remote registry
|
||||
|
||||
services:
|
||||
# ============================================================================
|
||||
# xiaozhi-server (Python WebSocket Server)
|
||||
# ============================================================================
|
||||
xiaozhi-esp32-server:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: xiaozhi-esp32-server:local
|
||||
container_name: xiaozhi-esp32-server
|
||||
depends_on:
|
||||
xiaozhi-esp32-server-db:
|
||||
condition: service_healthy
|
||||
xiaozhi-esp32-server-redis:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- xiaozhi-network
|
||||
ports:
|
||||
# WebSocket server
|
||||
- "8000:8000"
|
||||
# HTTP server for vision analysis and OTA
|
||||
- "8003:8003"
|
||||
security_opt:
|
||||
- seccomp:unconfined
|
||||
healthcheck:
|
||||
disable: true
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- PYTHONUNBUFFERED=1
|
||||
- LOG_LEVEL=INFO
|
||||
- REGION=US-WEST-2
|
||||
volumes:
|
||||
# Configuration directory
|
||||
- ./data:/opt/xiaozhi-esp32-server/data
|
||||
# Custom config (optional override, uncomment if you need to customize)
|
||||
- ./custom_config.yaml:/opt/xiaozhi-esp32-server/custom_config.yaml
|
||||
# Model files (important!)
|
||||
- ./models/SenseVoiceSmall:/opt/xiaozhi-esp32-server/models/SenseVoiceSmall
|
||||
- ./models/snakers4_silero-vad:/opt/xiaozhi-esp32-server/models/snakers4_silero-vad
|
||||
# Temporary files
|
||||
- ./tmp:/opt/xiaozhi-esp32-server/tmp
|
||||
# Music files (optional)
|
||||
- ./music:/opt/xiaozhi-esp32-server/music
|
||||
# Logs (optional, for debugging)
|
||||
- ./logs:/opt/xiaozhi-esp32-server/logs
|
||||
|
||||
# ============================================================================
|
||||
# manager-web (Management Console + API)
|
||||
# ============================================================================
|
||||
xiaozhi-esp32-server-web:
|
||||
# Build from local source (supports ARM64/Apple Silicon)
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: Dockerfile-web
|
||||
image: xiaozhi-esp32-server-web:local
|
||||
|
||||
# Option: Use pre-built image from registry (x86 only)
|
||||
# image: ghcr.nju.edu.cn/xinnan-tech/xiaozhi-esp32-server:web_latest
|
||||
# platform: linux/amd64 # Uncomment to force x86 emulation on ARM64
|
||||
|
||||
container_name: xiaozhi-esp32-server-web
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- xiaozhi-network
|
||||
depends_on:
|
||||
xiaozhi-esp32-server-db:
|
||||
condition: service_healthy
|
||||
xiaozhi-esp32-server-redis:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
# Management console and API
|
||||
- "8002:8002"
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- SPRING_PROFILES_ACTIVE=dev
|
||||
# Database connection
|
||||
- SPRING_DATASOURCE_DRUID_URL=jdbc:mysql://xiaozhi-esp32-server-db:3306/xiaozhi_esp32_server?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&connectTimeout=30000&socketTimeout=30000&autoReconnect=true&failOverReadOnly=false&maxReconnects=10
|
||||
- SPRING_DATASOURCE_DRUID_USERNAME=root
|
||||
- SPRING_DATASOURCE_DRUID_PASSWORD=123456
|
||||
# Redis connection
|
||||
- SPRING_DATA_REDIS_HOST=xiaozhi-esp32-server-redis
|
||||
- SPRING_DATA_REDIS_PORT=6379
|
||||
- SPRING_DATA_REDIS_PASSWORD=
|
||||
volumes:
|
||||
# Upload files directory
|
||||
- ./uploadfile:/uploadfile
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
# ============================================================================
|
||||
# MySQL Database
|
||||
# ============================================================================
|
||||
xiaozhi-esp32-server-db:
|
||||
image: mysql:8.0
|
||||
container_name: xiaozhi-esp32-server-db
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- xiaozhi-network
|
||||
ports:
|
||||
# Expose MySQL port for local debugging (optional)
|
||||
- "3307:3306"
|
||||
volumes:
|
||||
# Persistent database storage
|
||||
- ./mysql/data:/var/lib/mysql
|
||||
# MySQL configuration (optional)
|
||||
# - ./mysql/conf:/etc/mysql/conf.d
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- MYSQL_ROOT_PASSWORD=123456
|
||||
- MYSQL_DATABASE=xiaozhi_esp32_server
|
||||
- MYSQL_INITDB_ARGS=--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
||||
command:
|
||||
- --character-set-server=utf8mb4
|
||||
- --collation-server=utf8mb4_unicode_ci
|
||||
- --default-authentication-plugin=mysql_native_password
|
||||
- --max_connections=1000
|
||||
- --max_allowed_packet=256M
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p123456"]
|
||||
timeout: 45s
|
||||
interval: 10s
|
||||
retries: 10
|
||||
start_period: 60s
|
||||
|
||||
# ============================================================================
|
||||
# Redis Cache
|
||||
# ============================================================================
|
||||
xiaozhi-esp32-server-redis:
|
||||
image: redis:7-alpine
|
||||
container_name: xiaozhi-esp32-server-redis
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- xiaozhi-network
|
||||
ports:
|
||||
# Expose Redis port for local debugging (optional)
|
||||
- "6380:6379"
|
||||
volumes:
|
||||
# Persistent Redis data (optional)
|
||||
- ./redis/data:/data
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
command: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "5m"
|
||||
max-file: "3"
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
|
||||
# ============================================================================
|
||||
# Networks
|
||||
# ============================================================================
|
||||
networks:
|
||||
xiaozhi-network:
|
||||
driver: bridge
|
||||
name: xiaozhi-network
|
||||
|
||||
# ============================================================================
|
||||
# Volumes (optional - for named volumes instead of bind mounts)
|
||||
# ============================================================================
|
||||
# volumes:
|
||||
# mysql-data:
|
||||
# redis-data:
|
||||
|
||||
Loading…
Reference in a new issue