Subject: Issue Deploying FastAPI Backend on Railway with Docker
abidjohar
PROOP

3 months ago

Hi sir,

I am trying to deploy my FastAPI backend on Railway using a Dockerfile, but I’m running into an issue where the container fails to start. Sometimes the error shows poetry: not found, and other times it shows uvicorn: not found.

Here is a snippet of the error during deployment:

[Region: us-east4]
=========================
Using Detected Dockerfile
=========================

Container failed to start
=========================
The executable `/root/.local/bin/uvicorn` could not be found.

I have installed dependencies globally using Poetry in the Dockerfile, so I expected uvicorn to be available, but it still cannot be found when the container starts.

I suspect this may be related to Poetry’s default installation path not being included in the container’s PATH, or the commands being executed outside the virtual environment.

Could you please guide me on the correct approach to ensure that both Poetry and Uvicorn are properly available in the Docker container at runtime?

Thank you for your help.

Best regards,
Abid Hussain

$10 Bounty

2 Replies

Railway
BOT

3 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


3 months ago

Is this not a repost of another thread from earlier today?

Edit:

Yes it is. Here is the original thread:

https://station.railway.com/questions/issue-deploying-fast-api-backend-on-railw-9dabf59f

Please refer to my response there; let me know if it worked.


Loading...