Commit a43390f3 by imwangxiaozhou

feat: 新增一键启动脚本并更新部署配置

- 新增日志存储路径环境变量LLMCP_LOG_STORAGE_PATH至配置文件
- 新增Windows一键启动批处理脚本start-all.bat
- 更新docker-compose.yml:移除内置MySQL服务,调整数据库连接参数与日志挂载配置
1 parent acd73975
...@@ -158,6 +158,7 @@ class Settings: ...@@ -158,6 +158,7 @@ class Settings:
"LLMCP_JWT_EXPIRATION_MINUTES": ("JWT_EXPIRATION_MINUTES", int), "LLMCP_JWT_EXPIRATION_MINUTES": ("JWT_EXPIRATION_MINUTES", int),
"LLMCP_ENCRYPTION_KEY": ("ENCRYPTION_KEY", str), "LLMCP_ENCRYPTION_KEY": ("ENCRYPTION_KEY", str),
"LLMCP_LOG_LEVEL": ("LOG_LEVEL", str), "LLMCP_LOG_LEVEL": ("LOG_LEVEL", str),
"LLMCP_LOG_STORAGE_PATH": ("LOG_STORAGE_PATH", str),
} }
for env_var, (attr, typ) in mapping.items(): for env_var, (attr, typ) in mapping.items():
val = os.environ.get(env_var) val = os.environ.get(env_var)
......
...@@ -5,37 +5,15 @@ services: ...@@ -5,37 +5,15 @@ services:
ports: ports:
- "8011:8011" - "8011:8011"
environment: environment:
- LLMCP_DB_HOST=db - LLMCP_DB_HOST=192.168.3.92
- LLMCP_DB_PORT=3306 - LLMCP_DB_PORT=3308
- LLMCP_DB_USER=llm_platform - LLMCP_DB_USER=biz_multi_agentic
- LLMCP_DB_PASSWORD=llm_platform_pass - LLMCP_DB_PASSWORD=JEIjHeLT
- LLMCP_DB_NAME=llm_call_platform - LLMCP_DB_NAME=ai_llmbase
- LLMCP_ENCRYPTION_KEY=${LLMCP_ENCRYPTION_KEY:-change-me-in-production-must-be-32-bytes-long!} - LLMCP_ENCRYPTION_KEY=${LLMCP_ENCRYPTION_KEY:-change-me-in-production-must-be-32-bytes-long!}
- LLMCP_JWT_SECRET_KEY=${LLMCP_JWT_SECRET_KEY:-change-me-in-production} - LLMCP_JWT_SECRET_KEY=${LLMCP_JWT_SECRET_KEY:-change-me-in-production}
- LLMCP_LOG_LEVEL=INFO - LLMCP_LOG_LEVEL=INFO
depends_on: - LLMCP_LOG_STORAGE_PATH=/app/logs
db:
condition: service_healthy
restart: unless-stopped
db:
image: mysql:8.0.28
container_name: llm-call-platform-db
environment:
MYSQL_ROOT_PASSWORD: root_password
MYSQL_DATABASE: llm_call_platform
MYSQL_USER: llm_platform
MYSQL_PASSWORD: llm_platform_pass
ports:
- "3306:3306"
volumes: volumes:
- mysql_data:/var/lib/mysql - ./logs:/app/logs
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
timeout: 3s
retries: 10
restart: unless-stopped restart: unless-stopped
volumes:
mysql_data:
@echo off
chcp 65001 >nul
title LLM Call Platform - 一键启动
set ROOT=%~dp0
set BACKEND=%ROOT%backend
set FRONTEND=%ROOT%frontend
echo ========================================
echo LLM Call Platform - 启动所有服务
echo ========================================
echo.
:: 1. Redis
echo [1/4] 启动 Redis ...
start "Redis" /MIN redis-server
:: 等待 Redis 就绪
timeout /t 2 /nobreak >nul
:: 2. Celery Worker
echo [2/4] 启动 Celery Worker ...
cd /d "%BACKEND%"
start "Celery" /MIN cmd /c "celery -A app.celery_app worker -l info -P solo"
:: 3. 后端 FastAPI
echo [3/4] 启动后端 (uvicorn :8011) ...
cd /d "%BACKEND%"
start "Backend" cmd /c "python -m uvicorn app.main:app --host 0.0.0.0 --port 8011"
:: 4. 前端 Vite
echo [4/4] 启动前端 (vite :5273) ...
cd /d "%FRONTEND%"
start "Frontend" cmd /c "npm run dev"
echo.
echo ========================================
echo 所有服务已启动!
echo.
echo 后端 API: http://localhost:8011
echo 健康检查: http://localhost:8011/api/health
echo 前端页面: http://localhost:5273
echo 接口文档: http://localhost:8011/docs
echo ========================================
echo.
echo 按任意键关闭此窗口(服务将继续在后台运行)
pause >nul
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!