Skip to content

Commit

Permalink
Change default process type host to IPv6 ::
Browse files Browse the repository at this point in the history
IPv6 is the future. Here's some more context heroku/roadmap#40.

Related heroku/ruby-getting-started#165
  • Loading branch information
schneems committed Nov 23, 2024
1 parent 8491520 commit 1de4345
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions buildpacks/ruby/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Default process types defined by the Ruby buildpack now use IPv6 host `::` which is equivalent of IPv4 host `0.0.0.0`. This will only affect applications that do not define a `web` process type via the `Procfile` and [Procfile Cloud Native Buildpack](https://github.com/heroku/buildpacks-procfile). Those applications must make sure to update their configuration to bind to an IPv6 host. ([]())

### Added

- The buildpack now warns the user when environmental variables used in running the default process are not defined. ([#307](https://github.com/heroku/buildpacks-ruby/pull/307))

## [3.0.0] - 2024-05-17
Expand Down
3 changes: 2 additions & 1 deletion buildpacks/ruby/src/steps/get_default_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ fn default_rack() -> Process {
&[
"bundle exec rackup",
"--port \"${PORT:?Error: PORT env var is not set!}\"",
"--host \"0.0.0.0\"",
"--host \"::\"",
]
.join(" "),
])
Expand All @@ -88,6 +88,7 @@ fn default_rails() -> Process {
"bin/rails server",
"--port \"${PORT:?Error: PORT env var is not set!}\"",
"--environment \"$RAILS_ENV\"",
"--binding \"::\"",
]
.join(" "),
])
Expand Down
4 changes: 2 additions & 2 deletions docs/application_contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ Once an application has passed the detect phase, the build phase will execute to
- We will delete the least recently used (LRU) files first. Detected via file mtime.
- Process types:
- Given an application with the `railties` gem:
- We will default the web process to `bin/rails server` while specifying `-p $PORT` and `-e $RAILS_ENV"`. Use the `Procfile` to override this default.
- We will default the web process to `bin/rails server` while specifying `--port $PORT`, `--environment $RAILS_ENV"` and an IPv6 host with `--binding "::"` (equivalent of IPv4 host `0.0.0.0`). Use the `Procfile` to override this default.
- If `railties` gem is not found but `rack` gem is present and a `config.ru` file exists on root:
- We will default the web process to `rackup` while specifying `-p $PORT` and `-h 0.0.0.0`. Use the `Procfile` to override this default. .
- We will default the web process to `rackup` while specifying `--port $PORT` and IPv6 host with `--host "::"` (equivalent of IPv4 host `0.0.0.0`). Use the `Procfile` to override this default. .
- Environment variable defaults - We will set a default for the following environment variables:
- `JRUBY_OPTS="-Xcompile.invokedynamic=false"` - Invoke dynamic is a feature of the JVM intended to enhance support for dynamicaly typed languages (such as Ruby). This caused issues with Physion Passenger 4.0.16 and was disabled [details](https://github.com/heroku/heroku-buildpack-ruby/issues/145). You can override this value.
- `RACK_ENV=${RACK_ENV:-"production"}` - An environment variable that may affect the behavior of Rack based webservers and webapps. You can override this value.
Expand Down

0 comments on commit 1de4345

Please sign in to comment.