a month ago
Hey all,
I have been struggling with deploying IBeam to Railway for a very long time, please help me. One works by itself by creating a localhost server on port :5000 and connecting to itself, authenticating itself there. Then I as a user could connect from outside and send API requests to the server.
It's just that from the outside, from the "public net" despite any config, any redirect, I am unable to access the internal localhost :5000 port, I am getting 502 Application error. I have found an internal Railway proxy that redirects from some other port to localhost:5000, only IBeam doesn't expect to connect from there.
The best I could do would be to copy the Digitalocean deployment (https://github.com/Voyz/ibeam/wiki/Cloud-Deployment), but I just don't see through Railway's internal routing solution. Please help me!
Thank you very much!
1 Replies
a month ago
Bind IBeam to 0.0.0.0
and use Railway’s $PORT
env var instead of hardcoding localhost:5000
.
Example:
app.run(host="0.0.0.0", port=int(os.environ.get("PORT", 5000)))
Hi,
Thanks for your help. According to the documentation, there are two places where the PORT needs to be changed:
1) in the listenPort: 5000 variable in conf.yaml
2) in the IBEAMGATEWAYBASE_URL environment variable to localhost:${PORT}.
The railway has its own docker entrypoints, so for example it doesn't run plain docker commands, but does them itself. Is there any proven method to override the ${PORT} value in conf.yaml with the "railway" method to the value of the assigned environment variable? If I set the value of IBEAMGATEWAYBASE_URL under the Variables tab to https://localhost:${PORT}, does the system detect the PORT number allocated by railway?
Thank you!
Ps.: now I am playing with a custom GH repo with an own Dockerfile and shellscript, but I am struggling with losing the original Docker image entrypoint. Is there a "railway" way for bypassing this issue?
I think I figured it out. I have to allow the exact IP in the conf.yaml ips-allow section, wildcard not supported yet. Therefore I can't run IBeam on Railway, I guess, because I don't know the internal IP-address…