Skip to content

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

@dentarg

Description

@dentarg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions