New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the PORT environment variable for rails server #21267
Use the PORT environment variable for rails server #21267
Conversation
b175d3f
to
14da940
Compare
@@ -21,6 +21,13 @@ def with_rack_env(env) | |||
end | |||
end | |||
|
|||
def with_port(port) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we wait with the helper extraction until it's needed in other cases as well. Once they're extracted it's harder to clean em up when tests get deleted or changed.
This will need an entry in the CHANGELOG as well. |
14da940
to
306c14c
Compare
@senny done. |
Is not PORT too generic? I mean, in a machine with a lot of services running what PORT means? |
The
|
😢 Heroku always creating weird conventions. cc @schneems |
If Rails had set a convention before us, we would have followed it 😉 On Heroku it will help, but not that much. We already set this if you don't have a procfile: https://github.com/heroku/heroku-buildpack-ruby/blob/154fab366ff2a611893a825eff33d537d717a350/lib/language_pack/rails2.rb#L36. I think we generally recommend against using It looks like gunicorn for python supports $PORT: https://github.com/benoitc/gunicorn/blob/master/docs/source/2012-news.rst#0160--2012-11-19 All in all, it's a pretty simple patch and provide benefits. I'm 👍 . If issue arise from this I can own this minimal code path. |
Use the PORT environment variable for rails server
I don't like environment variables changing behavior, but yeah... it is already a convention. |
🎉 |
Allow the server port to be set with the
PORT
environment variable.