From 8245ee3ab490e1fd7cc01fed4473b5703b660668 Mon Sep 17 00:00:00 2001 From: Gabriel Carneiro Date: Thu, 5 Oct 2023 17:06:14 -0300 Subject: [PATCH] add gunicorn --- gunicorn_config.py | 2 ++ requirements.txt | 1 + src/stream_auth/main.py | 11 +++++------ 3 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 gunicorn_config.py diff --git a/gunicorn_config.py b/gunicorn_config.py new file mode 100644 index 0000000..625a149 --- /dev/null +++ b/gunicorn_config.py @@ -0,0 +1,2 @@ +workers = 4 # Adjust this based on your server's capabilities +bind = "0.0.0.0:8080" # Use the appropriate IP and port diff --git a/requirements.txt b/requirements.txt index ff01cfa..98a8d4f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ bcrypt flask pyjwt tinydb +gunicorn diff --git a/src/stream_auth/main.py b/src/stream_auth/main.py index 99ded9e..bd9bfd2 100644 --- a/src/stream_auth/main.py +++ b/src/stream_auth/main.py @@ -13,12 +13,11 @@ app = Flask(__name__) logging.basicConfig(level=logging.INFO) -def main(): - app.register_blueprint(user_routes) - app.register_blueprint(stream_routes) - - app.run(host=settings.HOST, port=settings.PORT) +# def main(*args, **kwargs): +app.register_blueprint(user_routes) +app.register_blueprint(stream_routes) if __name__ == "__main__": - main() + app.run(host=settings.HOST, port=settings.PORT) + # main()