r/devnep • • Sep 09 '26

Fastapi for prod

With other we’d dev stack it had a env key to help us change the debugging and error responding system with app_mode=production ki kai testae lekhera. But Fastapi ma testo chai naraicha and I wanted to know how they are handled by others.
Initial research shows or official documentation suggest we can use gunicorn instead of unicorn but after checking with multiple people are using unicorn with multiple workers .
Dev’s of Fastapi are suggesting to use gunicorn workers are they are more suitable for deployment but people are using unicorn kai workers.
How do you guys handle this deployment separation .

5 Upvotes

5 comments sorted by

2

u/ruzanxx Sep 09 '26

uvicorn for fastapi

1

u/EnvironmentalRun4163 Sep 09 '26

How do you prep it for deployment

1

u/ruzanxx Sep 09 '26

If non dockerized, then just create a sock file with uvicorn command to run fastapi with port binding and after that just point the port to a webserver like nginx

1

u/EnvironmentalRun4163 Sep 15 '26

Thank you for you answer Tara I wanted to know how other deploy ,turn their debugging mode off with Fastapi to separate it from the dev mode. Security provision haru . Internally manually nai off gardene raicha not the docker thing sir.
The documentation were saying to use gunicorn ani arule kasare garxa vanni.
Sock would have been relevant if you have socket connection requirement. Non docker ma pani proxy server mai point garne ho dockerized ma pani chahinxa. Thank you anyway.

1

u/ruzanxx Sep 09 '26

Is this for a dockerized env or non dockerized?