Variables Reoclo Sets
Reoclo sets environment variables from the domains attached to an application, so your code never has to hardcode its own address. Three of them are available while the image builds and while the container runs. A fourth carries the framing report address.
The variables
Section titled “The variables”| Variable | Value | Available |
|---|---|---|
REOCLO_PUBLIC_URL | The public URL of the primary domain, for example https://www.example.com | Build and run time |
REOCLO_PRIMARY_DOMAIN | The host of the primary domain, for example www.example.com | Build and run time |
REOCLO_DOMAINS | Every host of the application as a comma separated list, primary first | Build and run time |
REOCLO_CSP_REPORT_URL | The address browsers send framing reports to | Run time only, and only when you switch on Framing reports |
If the application has no active domain yet, none of the three domain variables is set. A missing variable is never an empty string.
REOCLO_CSP_REPORT_URL is not passed to builds and preview environments do not get it. See Framing reports.
The three domain variables are listed on the application page under Environment, Production, in the Injected by Reoclo (read-only) block above your own variables. The block shows the values the next deploy will use.
Which domains count
Section titled “Which domains count”- Only active domains bound to the application are listed. Wildcard domains are left out because they are not a concrete host.
- Redirect domains are listed in
REOCLO_DOMAINSas aliases after the primary. - The scheme is
httpsunless the domain’s route has TLS turned off or its scheme is set tohttp. - After the primary, domains are ordered by when you added them, then by name.
The primary domain
Section titled “The primary domain”REOCLO_PUBLIC_URL follows the primary domain. Until you choose one, the oldest active domain that serves the application is used (a redirect domain is never the primary).
Choose the primary domain in either place:
- Application page: the Primary domain selector under the injected variables.
- Domain page: Make primary in the Routing card. The primary domain shows a Primary tag.
If the chosen domain is later removed, disabled, or turned into a redirect, Reoclo falls back to the oldest active domain on its own. Nothing else changes.
Where the variables are available
Section titled “Where the variables are available”| Where | How |
|---|---|
| Container at run time | Set like any other environment variable |
| Docker build | Passed as --build-arg, so declare ARG REOCLO_PUBLIC_URL in your Dockerfile to read it |
| Docker Compose application | Written to the project .env, so ${REOCLO_PUBLIC_URL} works in your compose file |
| Stack | Each service gets the values of its own application, never another service’s. A service that builds an image also gets them as build args, unless your compose file already sets a build arg with the same name. A service that only pulls an image gets them at run time |
| Preview environment | All three name the preview host, never a production domain |
The deployed commit in a stack
Section titled “The deployed commit in a stack”A stack deploy also tells your compose file which commit it deployed. Reoclo writes these values to the stack’s .env, so ${VAR} works anywhere in the compose file:
| Variable | Value |
|---|---|
REOCLO_COMMIT_SHA | The full SHA of the commit the stack deployed |
REOCLO_COMMIT_SHORT_SHA | The first seven characters of that SHA |
REOCLO_COMMIT_REF | The branch or ref the deploy was for, for example main |
REOCLO_COMMIT_DATE | The commit’s date in ISO 8601, for example 2026-11-25T14:56:40+00:00 |
No service receives them in its environment unless your compose file passes them on. That keeps a new commit from recreating services that do not use it. To show the release from a service, pass the values through environment::
services: api: environment: APP_COMMIT: ${REOCLO_COMMIT_SHA:-dev} APP_COMMIT_DATE: ${REOCLO_COMMIT_DATE:-}A stack whose compose file is pasted into Reoclo has no repository to read, so it never gets REOCLO_COMMIT_DATE, and gets the other values only when the deploy names a commit or branch. As with the domain variables, a variable with the same name that you set yourself wins.
Your own values win
Section titled “Your own values win”Reoclo sets these first. An environment variable with the same name that you set yourself replaces the run-time value Reoclo would set, and a build argument with the same name replaces the build-time value. For run time, the order from lowest to highest is:
- Variables from your domains
- Your own environment variables
- Variables injected by service connections
The REOCLO_ prefix is reserved for Reoclo. Reoclo does not block these names, and the variable you set always wins, but avoid the prefix for your own variables: a name Reoclo adds later would stop reflecting your domains for any app that already sets it.
When your domains change
Section titled “When your domains change”The values are read at deploy time. If you add, remove, or change a domain, or choose another primary, the running container keeps the old values until the next deploy. The application page shows Redeploy to refresh your domain variables until you redeploy.
Reoclo does not redeploy for you, because a DNS change should not restart production by itself.
Saved changes and the running application
Section titled “Saved changes and the running application”Saved production environment changes apply on the next successful deploy. The application’s Overview shows Environment changed since the last deploy until those changes are applied.
This includes added, edited and deleted variables, changed secret bindings or referenced secret versions, service connections and recorded domain-derived changes. When your permissions allow it, the notice names the affected variables without showing their values. Preview-only edits do not mark production as pending.
Applications deployed before this tracking was introduced have an unknown baseline. They show no pending notice until a successful deploy records the environment. An unavailable baseline is not a claim that saved and running values match.
Your variables in pool builds
Section titled “Your variables in pool builds”A pool build does not read your application’s environment. To use one of your variables in a compose build argument, mark it as a Public build value when you add or edit it, or with reoclo env set --public-build. Reoclo then fills ${VAR} in the build argument with its value. The value ships in the image, so use it only for values that are public, such as NEXT_PUBLIC_ variables. For a token the build needs, mark it as a Build secret or read it with a compose build secret. See Build values and secrets.
Build secrets stay out of the running container
Section titled “Build secrets stay out of the running container”A variable marked as a Build secret is available to the build only. Your running container never receives it: it is not in the container’s environment, in the env file Reoclo writes for the container, or in a preview’s environment. This holds for applications, stacks and previews.
The deploy log of an application or stack lists the keys Reoclo held back, never their values: Build secrets kept out of the running container: NPM_TOKEN, SENTRY_AUTH_TOKEN. If your application needs a value at runtime, add it as a separate variable that is not marked as a build secret.