mirror of
https://github.com/chatfire-AI/huobao-drama.git
synced 2026-08-28 18:07:48 +08:00
45 lines
1.2 KiB
YAML
45 lines
1.2 KiB
YAML
services:
|
|
mysql:
|
|
image: mysql:8.4
|
|
environment:
|
|
MYSQL_DATABASE: huobao_drama
|
|
MYSQL_USER: huobao
|
|
MYSQL_PASSWORD: huobao
|
|
MYSQL_ROOT_PASSWORD: huobao_root
|
|
ports:
|
|
- "3307:3306"
|
|
volumes:
|
|
- mysql-data:/var/lib/mysql
|
|
command: ["--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci"]
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-phuobao_root"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 20
|
|
restart: unless-stopped
|
|
|
|
huobao-drama:
|
|
build: .
|
|
ports:
|
|
- "5679:5679"
|
|
volumes:
|
|
- ./data:/app/data
|
|
# skills 可在设置页在线编辑,且 workspace 是 Agent 文件读写 jail 根,需持久化
|
|
- ./backend/workspace:/app/backend/workspace
|
|
environment:
|
|
- NODE_ENV=production
|
|
- PORT=5679
|
|
- DATABASE_URL=mysql://huobao:huobao@mysql:3306/huobao_drama
|
|
depends_on:
|
|
mysql:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "node", "-e", "fetch('http://localhost:5679/api/v1/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
start_period: 15s
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
mysql-data:
|