Logo

Command Palette

Search for a command to run...

Rails and Rack Configuration

Rails

A Rails application type in the manifest file gives you fine control over things like the Ruby version or the server the rails application is deployed on.

OptionApplied onDescriptionClouds
activeprotectThe parent node for ActiveProtect settings (see whitelist and http_ban_rate below)All
activeprotect / whitelistA comma-separated whitelist of IPs that should be ignored by your ActiveProtect configuration. Must be nested under activeprotect.All
activeprotect / http_ban_rateSet the threshold of requests per minute from a single IP address. The default is 2000. Must be nested under activeprotect.All
asset_pipeline_precompileSpecify whether to use asset pipeline compilation - this will be taken into account during redeployment. NOTE: Rails only - does not apply to other Rack servers.All
bundler / optionsCustomise your bundle install command by specifying options. See below for some example options and defaults.All
do_initial_db_schema_loadSpecify whether to perform rake db:schema:load on a new application build.All
firewall / create_web_rulesCloud 66 automatically creates firewall rules to expose your web application to the outside world. You can configure this via your Traffic settings, or disable it completely by setting this value to false. Default is true.All
iam_instance_profile_nameThe name of the IAM instance profile that should be used when provisioning this server. Read our guide.AWS
include_submodulesSet this to false to exclude any Git submodules from being pulled during a build. Default is trueAll
instance_service_account_nameThe name of the GCE Service Account that should be used when provisioning this server.GCE
keep_releasesSpecify the number of releases to keep on your server(s). Default is 5.All
locked_passenger_versionForce the app to use a specific version of Passenger. This is not supported on Passenger Enterprise applications.All
memory_allocatorThe memory allocation library that will be used for your Ruby installation. Options are malloc or jemalloc. Defaults to malloc.All
nameserversSet DNS servers for your application. Note that if you specify empty array i.e [ ], it won't add any nameserver to your servers. Default is an empty array: [ ]All
network / modeSpecifies whether your servers should communicate over private or public IP addresses. Defaults to private if your servers are either all cloud or all Registered. If your application uses a mix of cloud and Registered servers, the default will be public.All
operating_systemThe version of Ubuntu to install on the server that hosts your application. Accepted values: ubuntu2204orubuntu2404 - this is governed by Ruby version.All
passenger_process_memoryA value (in MB) that Cloud 66 will use for each Passenger process. This is also used to calculate the value of the passenger_pool_max variable in your Nginx configuration which in turn sets passenger_max_pool_size.All
reserved_server_memoryA value in MB that Cloud 66 will assume should be left available. This will affect any automatically calculated values.All
root_disk_sizeDefault size of root disk (in GB) for servers used by application. Default value is 50.AWS, Azure, GCE
root_disk_typeDisk type, accepted values being ssd and magnetic. Default is ssd.AWS, GCE
ruby_versionSpecify the version of Ruby to use. Also applies when you want to upgrade your Ruby version. We recommend that you use this and remove the Ruby version declaration from your Gemfile to avoid situations where your application will not run on every server during an upgrade. Older versions of Ruby will limit the version of Ubuntu your servers can use.All
subnet_idID or name of the AWS subnet in which you would like to create your servers. If not supplied, we will attempt to identify the single subnet with map_public_ip_on_launch set to trueAWS
tagsAppend the listed tags to any servers created for this component. See our tagging guide for more info on tag syntax and support.AWS, Azure, DigitalOcean, Hetzner
vn_nameThe name of the Virtual Network in which you would like to create your servers.Azure
vpc_idID or name of the VPC in which you would like to create your servers.AWS, Azure, DigitalOcean, Hetzner

Example YAML for Rails

rails:
  configuration:
    ruby_version: 2.7.2
    asset_pipeline_precompile: true
    bundler:
      options:
        without: ["development", "test", "custom"]
    do_initial_db_schema_load: false
    reserved_server_memory: 0 #default value
    passenger_process_memory: 200 #default value
    memory_allocator: jemalloc # malloc is default
    locked_passenger_version: 4.0.59
    activeprotect:
      whitelist: 123.123.123.123,234.234.234.234
      http_ban_rate: 2000 # Default
    vpc_id: my-vpc-name
    root_disk_size: 100
    root_disk_type: ssd
    nameservers: ['8.8.8.8', '8.8.4.4']
    iam_instance_profile_name: rails-perms

Deployment Success Checks

These checks define tests to confirm whether your application has been successfully deployed, and to mark a deployment as "failed" if any do not pass. For more details on health checks please read our how-to guide. Health Checks have the following Manifest options:

OptionApplied onDescriptionClouds
protocolThe protocol(s) to use when running the check(s). Acceptable values are http or https.All
hostThe hostname or IP address that will we called during the check.All
portThe port number that must be used when submitting the request. The default is 80 if you set http as your protocol and 443 if you set it to httpsAll
endpointThe URL, path or endpoint that should be checked. This can be any URL in the application.All
acceptA comma separated list of the HTTP response codes that should be considered as a "pass" of this check. All values must be enclosed in quotes. Ranges can be defined with dashes and both the first and last port numbers must be included. For example ["200-201", "300-305"]All
follow_redirectsWhether to follow redirects when performing the check. The default value is true.All
timeoutThe wait, in seconds, before the check will time out. The max is 120.All

Example YAML for Deployment Success Checks

  rails:
    configuration:
      health_check:
        protocol: 'http'
        host: '127.0.0.1'
        port: 80
        endpoint: '/'
        accept: ["200"]
        follow_redirects: true
        timeout: 30

Node version (for Rails applications)

We automatically install the latest release of Node version 16.x.x when we set up your Rack.. application servers. You can control which version is installed by editing the manifest file for any Rails application as follows:

rails:
  configuration:
    node_version: "18"       # will install latest release of v18.x.x
rails:
  configuration:
    node_version: "18.1"  # will install latest v18.1.x

If you need a newer version of Node, you can install one using the same method above. We support any version of Node that is supported by our version manager (which itself supports the Node distribution list).

Rack

For Rack you should use the same settings as Rails but the top node in your YAML must be rack (see below). Also note that asset_pipeline_precompile only applies to Rails servers.

Example YAML for Rack

rack:
  configuration:
    ruby_version: 2.7.2
    do_initial_db_schema_load: false
    reserved_server_memory: 0 #default value
    passenger_process_memory: 200 #default value
    memory_allocator: jemalloc # malloc is default
    locked_passenger_version: 4.0.59
    activeprotect:
      whitelist: 123.123.123.123,234.234.234.234
    vpc_id: vpc-64872001
    root_disk_size: 100
    root_disk_type: ssd
    nameservers: ['8.8.8.8', '8.8.4.4']
    iam_instance_profile_name: rack-perms

Sinatra

For Sinatra use Rack