Configuration

DotEnv is a configuration pattern that loads environment variables from a .env file. Amezmo generates a .env file for you at instance creation time. This file is automatically available to you from your webroot. Depending on the options you've chosen at instance creation time, you will see a set of predefined variables.

When a new deployment happens, the most recent .env file is copied into your deployments target release directory.

Amezmo automatically generates a .env file for you when you launch an instance. You can edit this file at anytime from the configuration page. Upon updating your configuration from the dashboard, the updates are immediately copied into your current release directory. Amezmo does not validate your file before placing it inside the root of your current release directory tree.

Your workers are reloaded via SIGHUP after your configuration file is copied into your release directory.

Default variables

The following variables are automatically generated for you when you launch an instance.

APP_KEY

This a base64 encoded 32 bit random string using the AES-256-CBC cipher. This is a unique key to that's generated each time you launch an instance. The following is the PHP code used to generated this key.

'base64:'.base64_encode(random_bytes(32));

APP_DOMAIN

The internal domain for your instance. This will be in the form of example.lb2.amezmo.co

APP_HOSTNAME

The hostname that you provided when your instances was created. This is also called the instance name. This name can be used instead of the IP address when sharing instances.

APP_DEBUG

This is a boolean value with the default value of true

LOG_PATH

/webroot/logs/%s

%s is replaced with your hostname.

DB_HOST

Contains the hostname of your database host which is localhost

Hooks

Upon updating your configuration file, Amezmo will optionally execute a script on your behalf.

.amezmo/config/before-change

This script is executed before Amezmo places the updated configuration file into your current release directory.

.amezmo/config/after-change

This script is executed after the file was successfully copied to your current release directory, but before your workers are reloaded.

Limits

Configuration hooks have a 15 second timeout.

Need support?

We're always happy to help with either application or infrastructure questions Always feel free to reach out to us on Twitter, or contact support.

Subscribe