diff --git a/requirements.txt b/requirements.txt index 3ae439a..0d51479 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ flask SPARQLWrapper rdflib +inotify diff --git a/start.sh b/start.sh index 46e4931..9c2ca74 100644 --- a/start.sh +++ b/start.sh @@ -2,7 +2,7 @@ set -eu if [ ${MODE:-""} == "development" ]; then if [ -f /app/requirements.txt ]; then pip install -r /app/requirements.txt; fi - exec python web.py + exec gunicorn -k gthread --reload -c "$GUNICORN_CONF" "$APP_MODULE" else - exec gunicorn -k egg:meinheld#gunicorn_worker -c "$GUNICORN_CONF" "$APP_MODULE" + exec gunicorn -k gthread -c "$GUNICORN_CONF" "$APP_MODULE" fi diff --git a/web.py b/web.py index 905cb2c..62c8bac 100644 --- a/web.py +++ b/web.py @@ -26,15 +26,5 @@ # Import the app from the service consuming the template app_file = os.environ.get('APP_ENTRYPOINT') -try: - module_path = 'ext.app.{}'.format(app_file) - import_module(module_path) -except Exception: - helpers.logger.exception('Exception raised when importing app code') - -####################### -## Start Application ## -####################### -if __name__ == '__main__': - debug = os.environ.get('MODE') == "development" - app.run(debug=debug, host='0.0.0.0', port=80) +module_path = 'ext.app.{}'.format(app_file) +import_module(module_path)