-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.server.bat
More file actions
42 lines (34 loc) · 977 Bytes
/
.server.bat
File metadata and controls
42 lines (34 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
@echo off
setlocal
set VENV_DIR=venv
REM Check if the virtual environment directory exists
if not exist %VENV_DIR% (
echo Virtual environment not found. Creating...
python -m venv %VENV_DIR%
)
REM Check if requirements.txt exists
if exist requirements.txt (
echo Checking if all dependencies from requirements.txt are installed...
REM Get the list of installed packages
venv\Scripts\pip freeze > installed_packages.txt
REM Install missing packages
for /f "tokens=*" %%i in (requirements.txt) do (
findstr /i "%%i" installed_packages.txt >nul
if errorlevel 1 (
echo Installing %%i...
venv\Scripts\pip install %%i
) else (
echo %%i is already installed.
)
)
del installed_packages.txt
) else (
echo requirements.txt not found.
)
REM Run the main.py script using the python interpreter from the virtual environment
cls
echo Running app/app.py...
venv\Scripts\python.exe -m uvicorn app.app:app --host 0.0.0.0 --port 80
endlocal
pause
.start.bat