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 #!/bin/bash
if [ -z "$1" ]; then # $1 = flask port
echo "error: missing data path" # $2 = data path
if [ $# -lt 2 ]; then
echo "error: missing parameter"
exit -1 exit -1
fi fi
export FLASK_RUN_PORT="$1"
export FLASK_APP=server.py export FLASK_APP=server.py
export FLASK_DEBUG=1 export FLASK_DEBUG=1
export FLASK_ENV=development # TODO: FLASK_ENV=production export FLASK_ENV=development # TODO: FLASK_ENV=production
...@@ -12,4 +16,4 @@ export FLASK_ENV=development # TODO: FLASK_ENV=production ...@@ -12,4 +16,4 @@ export FLASK_ENV=development # TODO: FLASK_ENV=production
python3 -m venv ./ python3 -m venv ./
source bin/activate source bin/activate
pip3 install -e . pip3 install -e .
python3 server.py "$1" python3 server.py "$2"
...@@ -4,13 +4,14 @@ After=network.target ...@@ -4,13 +4,14 @@ After=network.target
[Service] [Service]
User=nobody User=nobody
Environment=FLASK_PORT=8081
Environment=DATA_PATH=/srv/www/data/ Environment=DATA_PATH=/srv/www/data/
Type=simple Type=simple
StandardOutput=null StandardOutput=null
StandardError=null StandardError=null
Restart=no Restart=no
WorkingDirectory=/usr/local/share/webapps-deliverer 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] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment