Aptible deploys all resources in Containers.
Containers run the command specified by the Service they belong to:
Containers run with three types of environment variables and if there is a name collision, Aptible Metadata takes precedence over App Configuration, which takes precedence over Docker Image Variables:
Docker Image Variables
Docker Images define these variables via the
ENV directive. They are present when your Containers start:
Aptible injects an App's Configuration as environment variables. For example, for the keys
aptible config:set --app "$APP_HANDLE" \ FOO=SOME BAR=OTHER
Aptible runs containers with the environment variables
BAR set respectively to
Finally, Aptible injects a set of metadata keys as environment variables.
These environment variables are accessible through the facilities exposed by the language, such as
ENV in Ruby,
process.env in Node, or
os.environ in Python.
Containers on Aptible are isolated. Use one of the following options to allow multiple Containers to communicate:
- For web APIs or microservices, set up an Endpoint and direct your requests to the Endpoint.
Containers on Aptible are frequently recycled during Operations - meaning new Containers are created during an Operation, and the old ones are terminated. This happens within the following Operations:
- Redeploying an App
- Restarting an App or Database
- Scaling an App or Database
Never use the filesystem to retain long-term data. Instead, store this data in a Database or a third-party storage solution, such as AWS S3 (see How do I accept file uploads when using Aptible? for more information).