This commit is contained in:
2026-04-07 21:54:04 +03:00

21
run.sh
View File

@@ -1,16 +1,19 @@
#!/bin/bash
# Активируем виртуальное окружение (если есть)
source venv/bin/activate
# 1. Снимаем блокировку Git (на случай, если что-то изменилось локально)
git reset --hard HEAD
git pull origin master
# Запускаем Бэкенд в фоне
# 2. Убиваем старые процессы, чтобы освободить порты 8000 и 8501
fuser -k 8000/tcp
fuser -k 8501/tcp
# 3. Запуск Бэкенда (указываем правильный файл main.py)
echo "Starting Backend..."
python3 app.py > backend.log 2>&1 &
nohup python3 main.py > backend.log 2>&1 &
# Запускаем Фронтенд в фоне
# 4. Запуск Фронтенда
echo "Starting Frontend..."
streamlit run ui.py --server.port 8501 > frontend.log 2>&1 &
nohup streamlit run ui.py --server.port 8501 > frontend.log 2>&1 &
echo "Services are running in background!"
echo "Backend: http://localhost:8000"
echo "Frontend: http://localhost:8501"
echo "Services started!"