diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..9af4d6b --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: gunicorn app:app --workers=4 \ No newline at end of file diff --git a/app.py b/app.py index 517fc86..a07fe1e 100644 --- a/app.py +++ b/app.py @@ -1,3 +1,4 @@ +import os from flask import Flask, render_template, redirect, request, url_for from flasgger import Swagger, swag_from @@ -109,3 +110,9 @@ def my_utility_processor(): return None return dict(get_list_of_people_and_workout_count=get_list_of_people_and_workout_count, is_selected_page=is_selected_page, get_first_element_from_list_with_matching_attribute=get_first_element_from_list_with_matching_attribute) + + +if __name__ == '__main__': + # Bind to PORT if defined, otherwise default to 5000. + port = int(os.environ.get('PORT', 5000)) + app.run(host='127.0.0.1', port=port) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..66c51a3 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +Flask==2.0.1 +gunicorn==19.7.1 +Jinja2==3.0.1 +flasgger==0.9.5 \ No newline at end of file