Cannot run fast-api service with uvicorn

michaurbanczykHOBBY

3 months ago

Hi!

I have my project where I am deploying fast-api service with websockets. By default it was deployed with gunicorn command but unfortunately websockets are not working. I changed deploy command and port in networking to 8000 so I have:

uvicorn main.app:app --host 0.0.0.0 --port 8000

but right now service started and then after few seconds is finished.

Will be very thankful for your help!

Best regards,

Michal

Solved

5 Replies

3 months ago

Looks like you're sorted! I'm gonna close this out, but please feel free to re-open this thread or make a new one if there's additional issues!


Status changed to Awaiting User Response railway[bot] 3 months ago


Status changed to Solved itsrems 3 months ago


Status changed to Awaiting Railway Response michaurbanczyk 3 months ago


itsrems

Looks like you're sorted! I'm gonna close this out, but please feel free to re-open this thread or make a new one if there's additional issues!

michaurbanczykHOBBY

3 months ago

Hey! Not sure why it was marked as solved. It is not I am still facing the issue and your help would be appreciated! Thank you!


3 months ago

Your app is running and reachable


Status changed to Awaiting User Response railway[bot] 3 months ago


michaurbanczykHOBBY

3 months ago

You are right, it works! If anybody face the same issue what I have done is I changed custom start command to:

uvicorn app.main:app --host 0.0.0.0 --port 8000

and in public networking I have added port 8000:

I am not sure why it was not working preliminary but right now it is perfect Thank you!

Attachments


Status changed to Awaiting Railway Response railway[bot] 3 months ago


3 months ago

Thank you for sharing! Going to mark this as solved so others can pop in and use your solution if they run into this in the future


Status changed to Awaiting User Response railway[bot] 3 months ago


Status changed to Solved ray-chen 3 months ago