tiangolo / full-stack-fastapi-template

Full stack, modern web application template. Using FastAPI, React, SQLModel, PostgreSQL, Docker, GitHub Actions, automatic HTTPS and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Customize uvicorn config

aaliboyev opened this issue · comments

This is dumb question, but I did not find a right answer to change the config of app in my backend container.
I tried to set GRACEFUL_TIMEOUT/TIMEOUT in .env file but that did not help.
I think it's because we are starting uvicorn server without any other config than host, port and log-level
Also I suspect there's an existing way of customizing other configs.
An if that is possible how can we use gunicorn for starting servers?
Thank you

I resolved the issue and closing the thread:
For those who might be looking for the samesolution.
I noticed that we are running on gunicorn on production mode and running the container with /start.sh script on the following repo
https://github.com/tiangolo/uvicorn-gunicorn-docker/blob/58ce0895f8c38b895e84f7ddb2128d66748b437c/docker-images/start.sh#L34

and on dev server we are running uvicorn.
So if 120 seconds timeout does not work for you or if you want to customize other configs there in the script you can see that it looks for gunicorn_conf.py file in your app and app/app directories and if it does not find any configs it defaults to the local /gunicorn_conf.py file here and there it tries to read some env variables. So this means you can set options in your .env or in tha backend containers env options.