R
Railway2y ago
demo

'$PORT' is not a valid port number

project id: a2eac5c1-4b4c-42b9-81a4-673deebff50e/service/b12c5811-0c8f-4703-91bd-265cc6743d17 screenshot of log attached pastebin of docker file https://pastebin.com/H27TRPXe start command being run: poetry run gunicorn project.app:app -b 0.0.0.0:$PORT --threads 12 I have a similar start command for a different project of mine, but that other project has no docker file. I think there is some issue w/ the final command accidentally having the $PORT variable escaped? Any suggestions?
Pastebin
FROM python:3.10 WORKDIR /app# Instruction to change environmentRUN...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
5 Replies
Percy
Percy2y ago
Project ID: a2eac5c1-4b4c-42b9-81a4-673deebff50e,b12c5811-0c8f-4703-91bd-265cc6743d17
Percy
Percy2y ago
To fix this, you have to ensure that your app is exposing the port that Railway expects. You can set the port that Railway expects by setting the PORT environment variable to a 4 digit number (usually 3000, 8000, 8080). Once you've done that, set the port that your app is exposed on. This is usually done through a PORT variable in your code.
⚠️ experimental feature
demo
demoOP2y ago
^ tried that experimental but it seems that the request hangs for ~10s then times out attempting port 3000 now after doing 8000
Brody
Brody2y ago
doesnt gunicorn listen on 0.0.0.0 and $PORT by default?
demo
demoOP2y ago
I don't believe it listens on $PORT but I will attempt removing that part you are correct, shows what I know I've been using it that way for years
Want results from more Discord servers?
Add your server