Preview Deployments could have different environment variables, so you can test your application as a staging environment for example.
Build Time Variables
If you would like to set environment variables for the build process, you can do by settingBuild Variable
on the UI.
Shared Variables
You could have 3 types of shared variables:- Team Based
- Project Based
- Environment Based (production, staging, etc.)
NODE_ENV
to production
.
Team Based
You can set them on theTeam
page and use it with {{team.NODE_ENV}}
.
Project Based
You can set them on theProjects
page, under the gear icon and use it with {{project.NODE_ENV}}
.
Environment Based
You can set them on theEnvironments
page (select a Project
), under the gear icon and use it with {{environment.NODE_ENV}}
.
Predefined Variables
Coolify predefines some variables for you, so you can use them in your application. All you need to do is to add an environment variable like this to your application.COOLIFY_FQDN
Fully qualified domain name(s) of the application.
COOLIFY_URL
URL(s) of the application.
COOLIFY_BRANCH
Branch name of the source code.
COOLIFY_CONTAINER_NAME
Name of the container generated by Coolify.
SOURCE_COMMIT
Commit hash of the source code.
PORT
If not set: it is set to the Port Exposes
’s first port.
HOST
If not set: it is set to 0.0.0.0
.