Environment Variables Substitutions

Environment Variables on Steroids

It is possible to replace certain placeholders in environment variable values for configuring things like dependency hostnames, public endpoints, acquiring items from resource pool etc. Here's an exhaustive list of all such placeholders you can use:

DOCKUP_SERVICE_<container_name>

Gets replaced by the hostname of the container.

Example : "REDIS_URL" => "redis://${DOCKUP_SERVICE_redis}:6379"

becomes "REDIS_URL" => "redis://redis-123-service:6379"

DOCKUP_PORT_ENDPOINT_<container_name>_<port>

Given a public port on a container, this gets replaced by the hostname.

Example: "MYAPP_LOGIN" => "${DOCKUP_PORT_ENDPOINT_myapp_3000}/login"

becomes "MYAPP_LOGIN" => "dockup-123.dockup.mycompany.com/login"

DOCKUP_PROXY_ENDPOINT_<proxy_name>

Given a proxy name, this gets replaced by the hostname.

Example: "MYAPP_LOGIN" => "${DOCKUP_PROXY_ENDPOINT_myproxy}/login"

becomes "MYAPP_LOGIN" => "dockup-123.dockup.mycompany.com/login"

DOCKUP_POOL_<pool_name>

Given a pool name, this reserves a free pool item from this pool for the deployment and replaces the placeholder with its value.

Example: "DB_NAME" => "${DOCKUP_POOL_dbpool}"

becomes "DB_NAME" => "dbpool-1"

DOCKUP_POOL_<pool_name>_ID_<Id>

You can even refer the same pool item multiple times in the same container or different containers (in the same blueprint) using the same environment variable. This is useful when you want to refer the same pool item value in multiple containers. For example, say you want refer the database url obtained from resource pool in the multiple containers.

Example: "DB_NAME" => "${DOCKUP_POOL_databases_ID_dbpool}"

becomes "DB_NAME" => "dbpool-1"

Any number of calls return the same value as long as identifier "dbpool" is same.

‚Äč