From e43c4a7f2a069170ce460a2bb189d7ba017c824d Mon Sep 17 00:00:00 2001 From: Jamie Banks Date: Fri, 19 Jun 2026 19:12:53 +0100 Subject: [PATCH] feat: automate virtual environment setup and use exec for gunicorn process management --- run.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/run.sh b/run.sh index 3ae4f0a..278b524 100755 --- a/run.sh +++ b/run.sh @@ -1,4 +1,16 @@ #!/bin/bash +if [ ! -d "venv" ]; then + echo "Creating virtual environment in 'venv'..." + python3 -m venv venv + source venv/bin/activate + if [ -f "requirements.txt" ]; then + echo "Installing requirements..." + pip install -r requirements.txt + fi +else + source venv/bin/activate +fi + cd frontend && npm run build && cd .. -gunicorn --bind 0.0.0.0:5000 --workers 1 --worker-class geventwebsocket.gunicorn.workers.GeventWebSocketWorker app:app --log-level info \ No newline at end of file +exec gunicorn --bind 0.0.0.0:5000 --workers 1 --worker-class geventwebsocket.gunicorn.workers.GeventWebSocketWorker app:app --log-level info \ No newline at end of file