Super lightweight interface for running and deploying gunicorn app processes.
Clone the project. Then create an alias to runapp.py to make it accessible as runapp in your terminal. For details on how to do that, scroll to the installation section at the bottom.
Create or copy the runapp.conf file to your app directory and edit the settings.
appname = myapp
appcall = app:hello
appuser = ray
appgroup = staff
workers = 2
port = 8000Additional options: Error log, SSL
error_log = error.log
sslcertkey = /srv/ssl.crt /srv/ssl.keycd myapprunapp
runapp start
runapp stop
runapp restart
runapp reload
runapp debug
runapp (list|-l)To simply print the gunicorn or shell command used and exit, add the -s option as the third parameter to any option above.
runapp start -s
runapp reload -s
runapp list -s
...To view the app settings config file or running process ids (if any), use the following options:
runapp (conf|-c)
runapp (pid|pids|-p)To debug the app, use the debug option to enter debug mode. This will stop the running app and start a gunicorn instance in standard (non-daemon) mode and will log errors to the specified error_log file in the config. The default file is error.log.
runapp debugOnce the debugging is complete, use Ctrl/Cmd+C to exit and restart the app normally.
Below are 2 options for creating an alias to runapp.py. In the following examples, you should replace {install} with the path to the directory where you cloned or downloaded this repository.
Option 1: Adding an alias in your bash config.
Depending on your system the file could be: ~/.bashrc, ~/.bash_aliases, or ~/.bash_profiles.
alias runapp='{install}/runapp/runapp.py'Option 2: Creating a symbolic link and adding it to the binary directory.
ln -s {install}/runapp/runapp.py /usr/bin/runappThe bin directory may differ based on your system. It could be /usr/bin, /usr/local/bin, /usr/opt/bin, etc.
Ported from the original Perl script version to Python 3. You can access the original perl version at ryt/runapp-perl.
Copyright © 2024 Ray Mentose.