conda create -n PanTS_backend python=3.11
conda activate PanTS_backend
cd flask-server
touch .env // makes .env file
nano .env
Inside .env file:
BASE_PATH=/
PANTS_PATH=/folder/where/PanTS
USE_SSL=false
Run backend:
pip install -r requirements.txt
python app.py
cd PanTS-Demo
touch .env
nano .env
Inside .env:
VITE_API_BASE=http://localhost:5001
npm install
npm run dev
After pushing changes, SSH into the server and run the following.
cd /home/visitor/PanTS-Viewer
git fetch
git pull
cd /home/visitor/PanTS-Viewer/PanTS-Demo && npm run build
# Kill the old gunicorn process
kill $(pgrep -f "gunicorn.*app:app")
# Start a new gunicorn process
nohup /home/visitor/.conda/envs/PanTS_backend/bin/gunicorn \
--worker-class gthread --workers 1 --threads 8 \
--bind 127.0.0.1:8000 --timeout 3600 \
--chdir /home/visitor/PanTS-Viewer/flask-server \
app:app > /tmp/gunicorn.log 2>&1 &
echo "PID: $!"
sleep 3 && curl http://127.0.0.1:8000/api/ping
Logs are written to /tmp/gunicorn.log.