-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
32 lines (23 loc) · 955 Bytes
/
Copy pathapp.py
File metadata and controls
32 lines (23 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import sys
sys.path.append("src")
# if os.environ.get("FLASK_DEBUG", "0") in [0, "0", "False", "flase"]:
# from gevent import monkey
# monkey.patch_all()
from src.create_app import create_application
app = create_application()
if __name__ == "__main__":
from src.create_app import app_config
if app_config.DEBUG:
app.run(debug=True, host="127.0.0.1", port=5001)
else:
# from gevent.pywsgi import WSGIServer
# WSGIServer(("127.0.0.1", 5001), app).serve_forever()
print("waitress-serve --listen=127.0.0.1:5001 app:app") # noqa: T201
print("OR") # noqa: T201
print("""gunicorn
--bind "${DIFY_BIND_ADDRESS:-0.0.0.0}:${DIFY_PORT:-5001}"
--workers ${SERVER_WORKER_AMOUNT:-1}
--worker-class ${SERVER_WORKER_CLASS:-gevent}
--worker-connections ${SERVER_WORKER_CONNECTIONS:-10}
--timeout ${GUNICORN_TIMEOUT:-200}
app:app""") # noqa: T201