Environment variables
Since v1.0
How to add a variable to a service
Section titled “How to add a variable to a service”To add a variable to a service, you can go to the service details page > Env variables tab.
- You can either add a single variable

- or add multiple variables from a
.envfile
How to add a variable to an environment
Section titled “How to add a variable to an environment”You can add variables to an environment by going to the project details page > Variables tab. Each variable added to an environment is available to all services in that environment.

You can also reference them in individual services by using a placeholder {{env.VARIABLE_NAME}}. All
referenced variables are replaced at runtime when your app has been deployed. if the
referenced variable doesn’t exist in the environment, the placeholder will not be replaced.
System environment variables
Section titled “System environment variables”ZaneOps provides a set of predefined variables you can use in your service.
-
ZANE- Example:
true - Flag indicating the service is deployed on ZaneOps.
- Example:
-
ZANE_DOMAINS- Example:
example.com,admin.example.com - Comma-separated list of all public domains where this service is accessible.
- Example:
-
ZANE_ENVIRONMENT- Example:
production - The environment name where the service is deployed (for example:
production,staging).
- Example:
-
ZANE_PRIVATE_DOMAIN- Example:
service.project.internal.zaneops - Internal project-scoped domain used to reach this service from other services in the same project.
- Example:
-
ZANE_GLOBAL_PRIVATE_DOMAIN- Example:
service.global.zaneops - Global domain used to reach this service across the ZaneOps platform (across projects).
- Example:
-
ZANE_DEPLOYMENT_TYPE- Example:
dockerorgit - The type of deployment for the service.
dockerindicates a container image;gitindicates a source-based deployment.
- Example:
-
ZANE_SERVICE_ID- Example:
srv_01F2ABC3D4 - The unique identifier for the service.
- Example:
-
ZANE_SERVICE_NAME- Example:
my-service - The slug or short name of the service.
- Example:
-
ZANE_PROJECT_ID- Example:
proj_0123ABCD - The id of the project this service belongs to.
- Example:
-
ZANE_DEPLOYMENT_SLOT- Example:
blueorgreen - The deployment slot for the running deployment (used for blue/green deployments).
This is also sent as the HTTP header
x-zane-dpl-sloton internal platform requests.
- Example:
-
ZANE_DEPLOYMENT_HASH- Example:
dpl_dkr_aBcDeFgHiJkLmN - The unique hash for this specific deployment. This is also sent as the HTTP header
x-zane-dpl-hash.
- Example: