Skip to content
Snippets Groups Projects
Commit a311d7ff authored by Rolf Niepraschk's avatar Rolf Niepraschk
Browse files

flask port as parameter

parent fa58ddae
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
if [ -z "$1" ]; then
echo "error: missing data path"
# $1 = flask port
# $2 = data path
if [ $# -lt 2 ]; then
echo "error: missing parameter"
exit -1
fi
export FLASK_RUN_PORT="$1"
export FLASK_APP=server.py
export FLASK_DEBUG=1
export FLASK_ENV=development # TODO: FLASK_ENV=production
......@@ -12,4 +16,4 @@ export FLASK_ENV=development # TODO: FLASK_ENV=production
python3 -m venv ./
source bin/activate
pip3 install -e .
python3 server.py "$1"
python3 server.py "$2"
......@@ -4,13 +4,14 @@ After=network.target
[Service]
User=nobody
Environment=FLASK_PORT=8081
Environment=DATA_PATH=/srv/www/data/
Type=simple
StandardOutput=null
StandardError=null
Restart=no
WorkingDirectory=/usr/local/share/webapps-deliverer
ExecStart=/bin/bash -l -c "source bin/activate;./server ${DATA_PATH}"
ExecStart=/bin/bash -l -c "source bin/activate;./server ${FLASK_PORT} ${DATA_PATH}"
[Install]
WantedBy=multi-user.target
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment