Dockerfile exposes port 8000. Railway domain link does not work unless PORT env var is set too
Is this expected behavior? I was told Railway would figure it out, and not require a PORT variable.
https://github.com/oatnog/hilopalace/blob/master/Dockerfile
https://hilopalace-production.up.railway.app/ says "Application Failed to Respond"
Service ID: 520ee4a3-6af7-4fd8-8f16-316cae380f90
GitHub
hilopalace/Dockerfile at master · oatnog/hilopalace
Contribute to oatnog/hilopalace development by creating an account on GitHub.
Solution:Jump to solution
gunicorn listens on $PORT by default, you can remove the bind and 8000 from your CMD
7 Replies
Project ID:
520ee4a3-6af7-4fd8-8f16-316cae380f90
correct you wouldn't be required to set your own PORT variable yourself, on one condition, your app needs to listen on the environment variable PORT, since railway auto generates one for you
so yes this is the expected behaviour
Okay! So my Dockerfile is the probelm
Solution
gunicorn listens on $PORT by default, you can remove the bind and 8000 from your CMD
you also don't need EXPOSE
Makes sense! Tested and it works.
I appreciate your help.
awesome