Configure for dokku deployment

This commit is contained in:
Peter Stockings
2022-09-10 14:15:04 +10:00
parent faa7c5789e
commit 0585865d4f
3 changed files with 12 additions and 0 deletions

1
Procfile Normal file
View File

@@ -0,0 +1 @@
web: gunicorn app:app --workers=4

7
app.py
View File

@@ -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)

4
requirements.txt Normal file
View File

@@ -0,0 +1,4 @@
Flask==2.0.1
gunicorn==19.7.1
Jinja2==3.0.1
flasgger==0.9.5