mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-04 21:39:49 +00:00
replace uwsgi with uvicorn
This commit is contained in:
18
docker_assets/backend_start.py
Executable file
18
docker_assets/backend_start.py
Executable 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,
|
||||
)
|
||||
@@ -34,13 +34,13 @@ server {
|
||||
}
|
||||
|
||||
location /api {
|
||||
include uwsgi_params;
|
||||
uwsgi_pass localhost:8080;
|
||||
include proxy_params;
|
||||
proxy_pass http://localhost:8080;
|
||||
}
|
||||
|
||||
location /admin {
|
||||
include uwsgi_params;
|
||||
uwsgi_pass localhost:8080;
|
||||
include proxy_params;
|
||||
proxy_pass http://localhost:8080;
|
||||
}
|
||||
|
||||
location /static/ {
|
||||
|
||||
@@ -20,4 +20,4 @@ nginx &
|
||||
celery -A task.celery worker --loglevel=INFO --max-tasks-per-child 10 &
|
||||
celery -A task beat --loglevel=INFO \
|
||||
--scheduler django_celery_beat.schedulers:DatabaseScheduler &
|
||||
uwsgi --ini uwsgi.ini
|
||||
python backend_start.py
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
[uwsgi]
|
||||
module = config.wsgi:application
|
||||
master = True
|
||||
pidfile = /tmp/project-master.pid
|
||||
vacuum = True
|
||||
max-requests = 5000
|
||||
socket = :8080
|
||||
buffer-size = 8192
|
||||
log-5xx = true
|
||||
log-4xx = true
|
||||
disable-logging = true
|
||||
Reference in New Issue
Block a user