From f5deb8ef41d421bf4d800e388cba90e8714b7a9f Mon Sep 17 00:00:00 2001 From: lza_menace Date: Fri, 25 Sep 2020 00:25:35 -0700 Subject: [PATCH] get it prod ready --- bin/prod | 8 ++++++++ requirements.txt | 1 + wowstash/app.py | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 bin/prod diff --git a/bin/prod b/bin/prod new file mode 100755 index 0000000..fc3f3f9 --- /dev/null +++ b/bin/prod @@ -0,0 +1,8 @@ +#!/bin/bash + +source .venv/bin/activate +export FLASK_APP=wowstash/app.py +export FLASK_SECRETS=config.py +export FLASK_DEBUG=0 +export FLASK_ENV=production +gunicorn --bind 0.0.0.0:4000 "wowstash.app:app" -D --log-file ./data/app.log diff --git a/requirements.txt b/requirements.txt index 040b815..137be50 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,3 +11,4 @@ qrcode Pillow docker elasticsearch +gunicorn diff --git a/wowstash/app.py b/wowstash/app.py index e6f5959..30b7f3c 100644 --- a/wowstash/app.py +++ b/wowstash/app.py @@ -1,6 +1,6 @@ from wowstash.factory import create_app +app = create_app() if __name__ == '__main__': - app = create_app() app.run()