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.
Option | Applied on | Description | Clouds |
---|---|---|---|
activeprotect | The parent node for ActiveProtect settings (see whitelist and http_ban_rate below) | All | |
activeprotect / whitelist | A comma-separated whitelist of IPs that should be ignored by your ActiveProtect configuration. Must be nested under activeprotect . | All | |
activeprotect / http_ban_rate | Set the threshold of requests per minute from a single IP address. The default is 2000 . Must be nested under activeprotect . | All | |
asset_pipeline_precompile | Specify 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 / options | Customise your bundle install command by specifying options. See below for some example options and defaults. | All | |
do_initial_db_schema_load | Specify whether to perform rake db:schema:load on a new application build. | All | |
firewall / create_web_rules | Cloud 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_name | The name of the IAM instance profile that should be used when provisioning this server. Read our guide. | AWS | |
include_submodules | Set this to false to exclude any Git submodules from being pulled during a build. Default is true | All | |
instance_service_account_name | The name of the GCE Service Account that should be used when provisioning this server. | GCE | |
keep_releases | Specify the number of releases to keep on your server(s). Default is 5 . | All | |
locked_passenger_version | Force the app to use a specific version of Passenger. This is not supported on Passenger Enterprise applications. | All | |
memory_allocator | The memory allocation library that will be used for your Ruby installation. Options are malloc or jemalloc . Defaults to malloc . | All | |
nameservers | Set 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 / mode | Specifies 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_system | The version of Ubuntu to install on the server that hosts your application. Accepted values: ubuntu2204orubuntu2404 - this is governed by Ruby version. | All | |
passenger_process_memory | A 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_memory | A value in MB that Cloud 66 will assume should be left available. This will affect any automatically calculated values. | All | |
root_disk_size | Default size of root disk (in GB) for servers used by application. Default value is 50. | AWS, Azure, GCE | |
root_disk_type | Disk type, accepted values being ssd and magnetic . Default is ssd . | AWS, GCE | |
ruby_version | Specify 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_id | ID 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 true | AWS | |
tags | Append 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_name | The name of the Virtual Network in which you would like to create your servers. | Azure | |
vpc_id | ID or name of the VPC in which you would like to create your servers. | AWS, Azure, DigitalOcean, Hetzner |
In order to use an AWS vpc_id, you must provide subnet_id for all servers used by your application.
Example YAML for Rails
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:
Option | Applied on | Description | Clouds |
---|---|---|---|
protocol | The protocol(s) to use when running the check(s). Acceptable values are http or https . | All | |
host | The hostname or IP address that will we called during the check. | All | |
port | The 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 https | All | |
endpoint | The URL, path or endpoint that should be checked. This can be any URL in the application. | All | |
accept | A 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_redirects | Whether to follow redirects when performing the check. The default value is true. | All | |
timeout | The wait, in seconds, before the check will time out. The max is 120. | All |
Example YAML for Deployment Success Checks
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:
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).
To apply changes to the Node version you need to update your manifest file, then deploy-with-options and select the Apply Ruby/Node upgrades option.
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
Sinatra
For Sinatra use Rack