replace uwsgi with uvicorn

This commit is contained in:
Simon
2024-12-23 21:53:27 +07:00
parent e5e51f1a60
commit 7dcef45b97
9 changed files with 69 additions and 42 deletions

18
docker_assets/backend_start.py Executable file
View File

@@ -0,0 +1,18 @@
"""start backend python application, read env var"""
from os import environ
import uvicorn
LOG_LEVEL = "info" if environ.get("DJANGO_DEBUG") else "error"
PORT = int(environ.get("TA_BACKEND_PORT", 8080))
if __name__ == "__main__":
uvicorn.run(
"config.asgi:application",
host="0.0.0.0",
port=PORT,
workers=4,
log_level=LOG_LEVEL,
reload=False,
)