mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2025-08-16 12:52:38 +08:00
Update the granian env to command params (#712)
This commit is contained in:
17
Dockerfile
17
Dockerfile
@ -49,23 +49,6 @@ RUN mkdir -p /var/log/fastapi_server
|
|||||||
|
|
||||||
EXPOSE 8001
|
EXPOSE 8001
|
||||||
|
|
||||||
# Granian env
|
|
||||||
ENV GRANIAN_HOST=0.0.0.0 \
|
|
||||||
GRANIAN_PORT=8001 \
|
|
||||||
# 并行工作进程数
|
|
||||||
GRANIAN_WORKERS=1 \
|
|
||||||
# 监听队列
|
|
||||||
GRANIAN_BACKLOG=1024 \
|
|
||||||
# 每个工作进程处理超时时间
|
|
||||||
GRANIAN_WORKERS_KILL_TIMEOUT=120 \
|
|
||||||
# 每个工作进程最大并发量
|
|
||||||
GRANIAN_BACKPRESSURE=2000 \
|
|
||||||
# PID 文件
|
|
||||||
GRANIAN_PID_FILE='/var/run/granian.pid' \
|
|
||||||
# 日志
|
|
||||||
GRANIAN_LOG_ENABLED=true \
|
|
||||||
GRANIAN_LOG_LEVEL='debug'
|
|
||||||
|
|
||||||
CMD ["/usr/local/bin/granian", "main:app", "--interface", "asgi", "--host", "0.0.0.0", "--port","8000"]
|
CMD ["/usr/local/bin/granian", "main:app", "--interface", "asgi", "--host", "0.0.0.0", "--port","8000"]
|
||||||
|
|
||||||
# === Celery server image ===
|
# === Celery server image ===
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[program:fastapi_server]
|
[program:fastapi_server]
|
||||||
directory=/fba/backend
|
directory=/fba/backend
|
||||||
command=/usr/local/bin/granian main:app --interface asgi
|
command=/usr/local/bin/granian main:app --interface asgi --host 0.0.0.0 --port 8001 --workers 1 --backlog 1024 --workers-kill-timeout 120 --backpressure 2000 --pid-file /var/run/granian.pid --log --log-level debug
|
||||||
user=root
|
user=root
|
||||||
autostart=true
|
autostart=true
|
||||||
autorestart=true
|
autorestart=true
|
||||||
|
Reference in New Issue
Block a user