Modify launch script and improve install script

Now universally refers to python3 instead of expecting gunicorn to be on
PATH.
Now installs requirements into system user's environment for use.
This commit is contained in:
Riley Housden 2021-11-30 02:02:09 -05:00
parent f1c3e05d80
commit e8cb428fa4
Signed by: InValidFire
GPG key ID: 0D6208F6DF56B4D8
2 changed files with 2 additions and 1 deletions

View file

@ -1,5 +1,6 @@
adduser --system --home /otp/radical-api radical-api
cp -r * /otp/radical-api
sudo -u radical-api python3 -m pip install -r /otp/radical-api/requirements.txt
cp radical-api.service /etc/systemd/system
addgroup --system radical-api
adduser radical-api radical-api

2
main.py Normal file → Executable file
View file

@ -2,7 +2,7 @@ import sys
from core.wrapper import Wrapper
api = Wrapper(['gunicorn', "-k", "uvicorn.workers.UvicornWorker",
api = Wrapper(['python3', '-m', 'gunicorn', "-k", "uvicorn.workers.UvicornWorker",
"--log-config", "log.conf",
'--bind', '0.0.0.0:8000',
'api:api'], sys.stdout)