I am trying to deploy my FastAPI backend on Fly.io, but am running into issues because my app is not listening on the ‘expected address’ which causes slowdowns from Fly.io. Here are their listening port docs.
I would like to configure my FastAPI backend to run on the expected host + port, specifically 0.0.0.0:8000
.
How can I do this? I don’t invoke the server startup manually with uvicorn
, as many older posts for FastAPI suggest. Do I need to add an arg to the app = FastAPI()
line in my main script?