From c4800ddf55b0e5a08f6b55b55760d11d651f2009 Mon Sep 17 00:00:00 2001 From: wangjiacai Date: Sat, 8 Apr 2023 10:41:13 +0800 Subject: [PATCH] start server with waitress --- Dockerfile | 3 ++- project/__init__.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a5135b2..eb4072a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,4 +6,5 @@ RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple RUN python3 -m pip install --upgrade pip && pip3 install --upgrade setuptools COPY . /web-gpt RUN pip3 install -r /web-gpt/requirements.txt -CMD cd /web-gpt && flask --app=project run --host=0.0.0.0 \ No newline at end of file +RUN pip3 install waitress +CMD cd /web-gpt && waitress-serve --listen 0.0.0.0:5000 project:app \ No newline at end of file diff --git a/project/__init__.py b/project/__init__.py index ebf2a76..3bf9a53 100644 --- a/project/__init__.py +++ b/project/__init__.py @@ -45,3 +45,6 @@ def create_app(): app.register_blueprint(main_blueprint) return app + + +app = create_app()