feat: add env vars for all cli options FASTAPI_<opt> * (and handle PORT)#217
feat: add env vars for all cli options FASTAPI_<opt> * (and handle PORT)#217babs wants to merge 2 commits intofastapi:mainfrom
FASTAPI_<opt> * (and handle PORT)#217Conversation
…y added `PORT` envvar Signed-off-by: Damien Degois <damien@degois.info>
…ng precedence Signed-off-by: Damien Degois <damien@degois.info>
|
@patrick91 , if environment variable support is to be adopted, it should fully embrace the philosophy of containerization rather than being limited to SaaS usage only. Focusing exclusively on fastapi-cli use within Docker environments adapted solely for SaaS risks overlooking broader, real-world use cases. I initiated this discussion earlier this year and volunteered to create this PR because I believe many users would greatly benefit from increased flexibility beyond SaaS, alignment with established containerization best practices, and a platform- and service-agnostic approach. Currently, limiting environment variable support guides developers building containers but restricts operators managing those containers from customizing behavior according to their specific environmental constraints. This limitation reduces the practical utility of fastapi-cli across diverse operational contexts. As promoted in the official FastAPI documentation, I believe it should converge more fully with the broader ecosystem it serves. I hope this clarifies the importance of fully supporting environment variables for all CLI options to provide flexibility and align with best practices. |
Following a discussion, this version handles both
PORTandFASTAPI_<ops>.Rework of #216 to handle all contraints (hosting provider and generic containerization orchestration)