Passing $PORT in start command
Is this possible? How could I achieve this?
I have a fastapi project running with the following command:
uvicorn main:app --host 0.0.0.0 --port ${PORT}
But I'm getting the following error:
Error: Invalid value for '--port': '${PORT}' is not a valid integer.
5 Replies
Try
$PORT
instead of ${PORT}
. If that doesn't work, try setting an arbitrary port of your choice and set that in your environment variable list as PORT
.Yep, you shouldn't need to pass PORT in your start command
$PORT
didn't work as well
I can't define it in the Dockerfile, how should I go about it?Try the second option: decide on an arbitrary port, and then stick it in your command and Railway env.
👍