finai/backend/run.bat

26 lines
745 B
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
chcp 65001 >nul
setlocal
cd /d "%~dp0"
if not exist ".venv\Scripts\python.exe" (
echo [backend] 未找到 .venv正在创建虚拟环境...
python -m venv .venv || goto :error
echo [backend] 正在安装依赖...
".venv\Scripts\python.exe" -m pip install --upgrade pip || goto :error
".venv\Scripts\python.exe" -m pip install fastapi "uvicorn[standard]" sqlalchemy "psycopg[binary]" pydantic-settings "python-jose[cryptography]" "passlib[bcrypt]" python-multipart httpx tencentcloud-sdk-python-lke || goto :error
)
echo [backend] 启动 uvicorn app.main:app https://0.0.0.0:8775 (SSL)
".venv\Scripts\python.exe" -m app.main
goto :end
:error
echo [backend] 启动失败
pause
exit /b 1
:end
endlocal
pause