Skip to content
Snippets Groups Projects

continuous deployment flask and react

Merged David Werner requested to merge feature/continuous-deploy into master
1 file
+ 7
7
Compare changes
  • Side-by-side
  • Inline
+ 7
7
@@ -3,7 +3,9 @@
set -eu # exit on error
set -x # show commands
# not implemented is to have backup/restore of the previous installation on fail of setup
rm -rf continuous-deployment || true
git clone https://git.iws.uni-stuttgart.de/dumux-appl/dumux-web-app.git continuous-deployment
cd continuous-deployment
@@ -20,23 +22,21 @@ python -m pip install --upgrade pip
pip install -r requirements.txt
pip install gunicorn
# install script which is run by systemctl; code is not yet in the master; thus now emitted from this script
# emit gunicorn-script used by systemd script
cat <<- EOF | tee gunicorn.cmdline.sh
cat <<- EOF > gunicorn.cmdline.sh
#!/bin/bash
source ./venv/bin/activate
which gunicorn
export FLASK_ENV=production
export FLASK_ENV=wsgi.py
# export FLASK_ENV=wsgi.py
export FLASK_APP_BASE_URL=/web-app
export FLASK_APP_SIMULATIONS_CONFIG=simulations.json
gunicorn -b "0.0.0.0:5000" --proxy-allow-from="*" --log-level debug --log-file=- --worker-tmp-dir /dev/shm --worker-class eventlet --workers 1 --threads 2 wsgi:application
# have log file and stdout for journald
gunicorn -b "0.0.0.0:5000" --proxy-allow-from="*" --log-level debug --log-file=- --worker-tmp-dir /dev/shm --worker-class eventlet --workers 1 --threads 2 wsgi:application | tee gunicorn.log
#./venv/bin/gunicorn -b "0.0.0.0:5000" --proxy-allow-from="127.0.0.1,129.69.98.210" --log-level debug --log-file=- "--worker-tmp-dir" "/dev/shm" "--worker -class" "eventlet" "--workers" "1" "--threads" "2" "wsgi:application"
EOF
chmod +x gunicorn.cmdline.sh
Loading