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
root
root3y ago
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.
angelo
angelo3y ago
Yep, you shouldn't need to pass PORT in your start command
heyronii
heyroniiOP3y ago
$PORT didn't work as well I can't define it in the Dockerfile, how should I go about it?
root
root3y ago
Try the second option: decide on an arbitrary port, and then stick it in your command and Railway env.
heyronii
heyroniiOP3y ago
👍
Want results from more Discord servers?
Add your server