Environment Variables

At runtime Apcera exposes and populates various environment variables for jobs, packages, and services.

Job variables

Environment Variable Purpose
HOME Root folder for the deployed application.
PATH system path used to search for executables.
PORT Port the app binds to. It can be specified on the route, else it is randomly chosen.
CNTM_HOST_IP IP address of the host of the isolation context.
CNTM_HOST_PORT hostip:port - hostip is the IP address of the host of the isolation context.
CNTM_PROCESS_NAME Name of the process from the Job.
CNTM_INSTANCE_UUID Instance UUID that identifies the process in the system.
CNTM_JOB_UUID UUID of the job.
CNTM_JOB_FQN FQN of the job.
ENV-SET Specify a custom envirnment variable.

Refer to the app selection and migration topic for examples of job environment variables.

Package variables

In addition to job variables, the system will also expose and populate package variables, an example of which is shown below:

screenshot

Service variables

Service bindings are stored as environment variables:

<service-type>_URI
<binding-name>_URI
<service-name>_URI

There are specific binding varables for JDBC:

JDBC_<service-type>_URI
<binding-name>_URI
<service-name>_URI

For example:

JDBC_MYSQL_URI
MYSQLSERVICE_URI
MYSQL_URI

Refer to the Service binding documentation for details.

APC variables

Apcera saves APC settings in the file .apc. It normally saves this file in your home directory, but you can specify a different location by setting the APC_HOME environment variable. See Installing APC for more information.