Files
dokku/docs/deployment/builders/railpack.md
Jose Diaz-Gonzalez 76b033234f fix: split report global keys into raw and computed across plugins
The `<plugin>-global-<property>` keys in `:report` output returned the resolved value with the built-in default substituted in, so external tooling could not distinguish a property that had been set globally to the default from one that had never been set. The bare keys for caddy, haproxy, and traefik global-only properties had the same shape. The `global-<property>` keys now hold the raw stored value and are empty when nothing has been set, and a new `computed-<property>` key holds the effective value used at runtime, falling back through the per-app value (where one exists), the global value, and the built-in default. The bare global-only keys for the three proxy plugins are removed in favor of the raw/computed pair. Closes #8631.
2026-05-23 00:05:33 -04:00

5.2 KiB

Railpack

Important

New as of 0.37.0

The railpack builder builds apps via Railpack, a buildpack alternative.

Usage

Requirements

Before using Railpacks, the following steps must be taken:

  • Install the railpack cli: The railpack cli tool is not included by default with Dokku or as a dependency. It must also be installed as shown on this page.
  • Create a buildkit builder: Railpack uses buildkit. shell docker run --rm --privileged -d --name buildkit moby/buildkit
  • Set the buildkit builder: Update the /etc/default/dokku file to set BUILDKIT_HOST: shell touch /etc/default/dokku echo "export BUILDKIT_HOST='docker-container://buildkit'" >> /etc/default/dokku

Detection

This builder will be auto-detected in the following case:

  • A railpack.json exists in the root of the app repository.

The builder may also be selected via the builder:set command

dokku builder:set node-js-app selected railpack

Supported languages

See the upstream railpack documentation for further information on what languages and frameworks are supported.

Build-time configuration variables

For security reasons - and as per Docker recommendations - railpack-based deploys have variables available only during runtime.

For users that require customization in the build phase, you may use build arguments via the docker-options plugin. All environment variables set by the config plugin are automatically exported within the railpack build environment, and thus --env only requires setting a key without a value.

dokku docker-options:add node-js-app build '--env NODE_ENV'

Alternatively, a full value may be provided in the form of --env KEY=VALUE:

dokku docker-options:add node-js-app build '--env NODE_ENV=production'

Changing the railpack.json location

The railpack.json is expected to be found in a specific directory, depending on the deploy approach:

  • The WORKDIR of the Docker image for deploys resulting from git:from-image and git:load-image commands.
  • The root of the source code tree for all other deploys (git push, git:from-archive, git:sync).

Sometimes it may be desirable to set a different path for a given app, e.g. when deploying from a monorepo. This can be done via the railpackjson-path property:

dokku builder-railpack:set node-js-app railpackjson-path .dokku/railpack.json

The value is the path to the desired file relative to the base search directory, and will never be treated as absolute paths in any context. If that file does not exist within the repository, the build will fail.

The default value may be set by passing an empty value for the option:

dokku builder-railpack:set node-js-app railpackjson-path

The railpackjson-path property can also be set globally. The global default is railpack.json, and the global value is used when no app-specific value is set.

dokku builder-railpack:set --global railpackjson-path railpack2.json

The default value may be set by passing an empty value for the option.

dokku builder-railpack:set --global railpackjson-path

Disabling cache

Disable cache using the [docker-options] plugin:

dokku docker-options:add node-js-app build "--no-cache"

Displaying builder-railpack reports for an app

You can get a report about the app's storage status using the builder-railpack:report command:

dokku builder-railpack:report
=====> node-js-app builder-railpack information
       Builder-railpack computed railpackjson path: railpack2.json
       Builder-railpack global railpackjson path:
       Builder-railpack railpackjson path:          railpack2.json
=====> python-sample builder-railpack information
       Builder-railpack computed railpackjson path: railpack.json
       Builder-railpack global railpackjson path:
       Builder-railpack railpackjson path:
=====> ruby-sample builder-railpack information
       Builder-railpack computed railpackjson path: railpack.json
       Builder-railpack global railpackjson path:
       Builder-railpack railpackjson path:

The railpackjson-path and global-railpackjson-path keys hold the raw per-app and global value respectively, and are empty when nothing has been set. The computed-railpackjson-path key holds the effective value used at build time, falling back to the global value (where one has been set) and then to the built-in default of railpack.json.

You can run the command for a specific app also.

dokku builder-railpack:report node-js-app
=====> node-js-app builder-railpack information
       Builder-railpack computed railpackjson path: railpack2.json
       Builder-railpack global railpackjson path:
       Builder-railpack railpackjson path:          railpack2.json

You can pass flags which will output only the value of the specific information you want. For example:

dokku builder-railpack:report node-js-app --builder-railpack-railpackjson-path
railpack2.json