Skip to content
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

Only add default web dyno if config.ru exists #1355

Open
dentarg opened this issue Jan 2, 2023 · 1 comment
Open

Only add default web dyno if config.ru exists #1355

dentarg opened this issue Jan 2, 2023 · 1 comment

Comments

@dentarg
Copy link

dentarg commented Jan 2, 2023

You could have an app that is not an web app, but for whatever reasons, it has rack as a dependency. Then, the buildpack would automatically add a web dyno to that app when it is deployed for the first time (maybe you do some automated testing with Terraform)

def self.use?
bundler.gem_version('rack')
end

I discussed changing this with @schneems at https://ruby.social/@Schneems/109514562198812396

I don't want to gate on random env vars in general if i can avoid it. I prefer to look for more specific signals if possible.

I would take a PR that gates this behavior on the existance of another file like config.ru considering we use that file in the command:

def default_process_types
# let's special case thin here if we detect it
web_process = bundler.has_gem?("thin") ?
"bundle exec thin start -R config.ru -e $RACK_ENV -p ${PORT:-5000}" :
"bundle exec rackup config.ru -p ${PORT:-5000}"
super.merge({
"web" => web_process
})
end

@schneems
Copy link
Contributor

Thanks a ton for the issue. I would accept this change.

dentarg added a commit to 84codes/heroku-buildpack-ruby that referenced this issue Feb 22, 2023
Temporary workaround for heroku#1355
walro pushed a commit to 84codes/heroku-buildpack-ruby that referenced this issue Sep 25, 2024
Temporary workaround for heroku#1355
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants