docs/configuration/overview.md
Configuration is read from the config/deploy.yml.
When running commands, you can specify a destination with the -d flag,
e.g., kamal deploy -d staging.
In this case, the configuration will also be read from config/deploy.staging.yml
and merged with the base configuration.
Kamal will not accept unrecognized keys in the configuration file.
However, you might want to declare a configuration block using YAML anchors and aliases to avoid repetition.
You can prefix a configuration section with x- to indicate that it is an
extension. Kamal will ignore the extension and not raise an error.
This is a required value. It is used as the container name prefix.
service: myapp
The image will be pushed to the configured registry.
image: my-image
Additional labels to add to the container:
labels:
my-label: my-value
Additional volumes to mount into the container:
volumes:
- /path/on/host:/path/in/container:ro
The Docker registry configuration, see Docker Registry:
registry:
...
The servers to deploy to, optionally with custom roles, see Servers:
servers:
...
env:
...
Used for asset bridging across deployments, default to nil.
If there are changes to CSS or JS files, we may get requests for the old versions on the new container, and vice versa.
To avoid 404s, we can specify an asset path. Kamal will replace that path in the container with a mapped volume containing both sets of files. This requires that file names change when the contents change (e.g., by including a hash of the contents in the name).
To configure this, set the path to the assets.
You can also specify mount options after a colon, such as ro for read-only
or z/Z for SELinux labels
asset_path: /path/to/assets
Path to hooks, defaults to .kamal/hooks.
See Hooks for more information:
hooks_path: /user_home/kamal/hooks
Path to secrets, defaults to .kamal/secrets.
Kamal will look for <secrets_path>-common and <secrets_path> (or <secrets_path>.<destination> when using destinations):
secrets_path: /user_home/kamal/secrets
A directory relative to the app root to find error pages for the proxy to serve. Any files in the format 4xx.html or 5xx.html will be copied to the hosts.
error_pages_path: public
Whether deployments require a destination to be specified, defaults to false:
require_destination: true
This defaults to web, but if you have no web role, you can change this:
primary_role: workers
Whether roles with no servers are allowed. Defaults to false:
allow_empty_roles: false
How many old containers and images we retain, defaults to 5:
retain_containers: 3
The minimum version of Kamal required to deploy this configuration, defaults to nil:
minimum_version: 1.3.0
Seconds to wait for a container to boot after it is running, default 7.
This only applies to containers that do not run a proxy or specify a healthcheck:
readiness_delay: 4
How long to wait for a container to become ready, default 30:
deploy_timeout: 10
How long to wait for a container to drain, default 30:
drain_timeout: 10
Directory to store kamal runtime files in on the host, default .kamal:
run_directory: /etc/kamal
See SSH:
ssh:
...
See Builders:
builder:
...
Additional services to run in Docker, see Accessories:
accessories:
...
Configuration for kamal-proxy, see Proxy:
proxy:
...
See SSHKit:
sshkit:
...
See Booting:
boot:
...
Docker logging configuration, see Logging:
logging:
...
Alias configuration, see Aliases:
aliases:
...