Sensitive environment variables
For security reasons, it's important to keep sensitive data, like access keys or security tokens, outside the code repository. Hosty is no-UI hosting blueprint, therefore there's no interface to add sensitive environment variables. However, Hosty has a recommended approach to deal with sensitive data.
Hosty assumes that deployments are handled in CI tools , like CircleCI or similar. These tools have mechanism to add environment variables and store them on their side. Then, during a deployment job in CI, there must be a step to create a .env file (the name can be different, but it's important to stick to the dotenv-like file structure). The last step is to configure Hosty to load environment variables from it. Let's look it each step is a bit more detail.

The name of the file with secrets can be any, as long as it follows dotenv file format.
For each application container, you can specify an optional parameter environmentFiles with the list of the dotenv-formatted files containing environment variables for the container. Here's an example for the php container:
Hosty will load environment variables from the file and make them available in the deployed container (in this particular example - php container).