mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
你的提交说明
This commit is contained in:
parent
c166f9b992
commit
dbc99bafc8
2 changed files with 113 additions and 0 deletions
106
docker-compose_all.yml
Normal file
106
docker-compose_all.yml
Normal file
|
|
@ -0,0 +1,106 @@
|
||||||
|
# Docker安装全模块
|
||||||
|
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
# Server模块
|
||||||
|
xiaozhi-esp32-server:
|
||||||
|
# ⭐ 用本地源码构建后端镜像
|
||||||
|
build:
|
||||||
|
# 以仓库根目录作为构建上下文(能看到 Dockerfile 和 main/)
|
||||||
|
context: ../..
|
||||||
|
# 在构建上下文里查找 Dockerfile-server
|
||||||
|
dockerfile: Dockerfile-server
|
||||||
|
# 本地镜像名字,随便起,和远程仓库无关
|
||||||
|
image: xiaozhi-esp32-server:dev
|
||||||
|
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:
|
||||||
|
# 配置文件目录(相对 main/xiaozhi-server)
|
||||||
|
- ./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:
|
||||||
|
# ⭐ 用本地源码构建 Web(Java + Vue)镜像
|
||||||
|
build:
|
||||||
|
context: ../..
|
||||||
|
dockerfile: Dockerfile-web
|
||||||
|
image: xiaozhi-esp32-server-web:dev
|
||||||
|
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:8.0
|
||||||
|
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:
|
||||||
|
|
@ -438,3 +438,10 @@ databaseChangeLog:
|
||||||
- sqlFile:
|
- sqlFile:
|
||||||
encoding: utf8
|
encoding: utf8
|
||||||
path: classpath:db/changelog/202512041515.sql
|
path: classpath:db/changelog/202512041515.sql
|
||||||
|
- changeSet:
|
||||||
|
id: 202512120922
|
||||||
|
author: xiaozhi
|
||||||
|
changes:
|
||||||
|
- sqlFile:
|
||||||
|
encoding: utf8
|
||||||
|
path: classpath:db/changelog/202512120922.sql
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue