From c434e64fb8f7264df119a2774f88372b6aaebe97 Mon Sep 17 00:00:00 2001 From: user01 Date: Mon, 25 May 2026 02:26:42 +0900 Subject: [PATCH] =?UTF-8?q?=EC=84=9C=EB=B2=84=20=EB=B0=B0=ED=8F=AC=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95:=20wsgi.py,=20gunicorn,=20start.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 4 +++- requirements.txt | 1 + start.sh | 5 +++++ wsgi.py | 4 ++++ 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 start.sh create mode 100644 wsgi.py diff --git a/app.py b/app.py index 361e09b..95356e9 100644 --- a/app.py +++ b/app.py @@ -960,6 +960,8 @@ def index(): if __name__ == '__main__': parser = argparse.ArgumentParser() + parser.add_argument('--host', default='127.0.0.1', help='Host to bind to') parser.add_argument('--port', type=int, default=5000, help='Port to run the server on') + parser.add_argument('--debug', action='store_true', help='Enable debug mode') args = parser.parse_args() - app.run(debug=True, port=args.port) + app.run(host=args.host, debug=args.debug, port=args.port) diff --git a/requirements.txt b/requirements.txt index bb70cce..9add4c1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ Flask==3.1.1 openpyxl==3.1.5 requests==2.32.3 +gunicorn==26.0.0 diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..f235f5d --- /dev/null +++ b/start.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "$0")" +[ -d venv ] && . venv/bin/activate +exec gunicorn wsgi:app --bind 0.0.0.0:5000 --workers 4 --timeout 120 diff --git a/wsgi.py b/wsgi.py new file mode 100644 index 0000000..3a43937 --- /dev/null +++ b/wsgi.py @@ -0,0 +1,4 @@ +from app import app + +if __name__ == '__main__': + app.run()