diff --git a/run.sh b/run.sh index b5cecc9..116a437 100755 --- a/run.sh +++ b/run.sh @@ -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" \ No newline at end of file +echo "Services started!" \ No newline at end of file