mirror of
https://github.com/docling-project/docling-serve.git
synced 2025-12-03 10:33:21 +00:00
Always load the app by using an import string Signed-off-by: Guillaume Moutier <3944034+guimou@users.noreply.github.com> Co-authored-by: Guillaume Moutier <3944034+guimou@users.noreply.github.com>
21 lines
475 B
Python
21 lines
475 B
Python
import os
|
|
|
|
from docling_serve.helper_functions import _str_to_bool
|
|
|
|
# Launch the FastAPI server
|
|
if __name__ == "__main__":
|
|
from uvicorn import run
|
|
|
|
port = int(os.getenv("PORT", "5001"))
|
|
workers = int(os.getenv("UVICORN_WORKERS", "1"))
|
|
reload = _str_to_bool(os.getenv("RELOAD", "False"))
|
|
|
|
run(
|
|
"docling_serve.app:app",
|
|
host="0.0.0.0",
|
|
port=port,
|
|
workers=workers,
|
|
timeout_keep_alive=600,
|
|
reload=reload,
|
|
)
|