Serverless Containers: Configuration & Environment Variables
This guide explains how configuration and environment variables work for Serverless Container applications in CloudRaya.
It focuses on how CloudRaya exposes a container-level configuration layer, how multi-container applications are handled, and which changes trigger a redeploy of the application runtime.
Configuration as a Runtime Layer
In CloudRaya, configuration is applied at the container runtime level, not at the infrastructure level.
Each Serverless Container application may consist of:
- A primary application container (for example, a web service)
- One or more supporting containers (for example, a database or background worker)
Environment variables act as the interface between your configuration and the running containers.
Default Environment Variables
When you deploy an application, CloudRaya automatically injects a set of default environment variables based on the selected application template.
Examples:
- Web applications may receive database connection variables
- CMS platforms may receive application keys or base URLs
- Database containers may receive user and password variables
These defaults are designed to make the application functional immediately after deployment. Two are common across templates: CLOUDRAYA_DEFAULT_HOST (the app's default domain) and CLOUDRAYA_RANDOM_PASSWORD, an auto-generated random value CloudRaya provides for the template to use. What it's used for depends on the app, some use it as an admin password, others for a different purpose. Check that app's own detail page for what its value is actually for.
You can view these variables in the Environment tab of the application detail page.
Multi-Container Awareness
Some Serverless Container applications run more than one container.
Examples include:
- A web container and a database container
- A main service and a background worker
In the Environment tab, you can:
- Select which container you want to configure
- View and edit variables that apply only to that container
This allows you to manage configuration per container, not just per application.
Reserved Variable Names
Variable names starting with the CLOUDRAYA_ prefix are reserved by the platform and are
ignored if you try to add them. Avoid this prefix when naming your own variables.
Adding and Updating Variables
The Environment tab lists your variables in a table (Key, Value, and per-row edit/delete actions), scoped to whichever container you have selected.
Adding a Variable
- Open Marketplace β My Apps
- Click your application
- Open the Environment tab
- Click Add Variable
- Choose the target container from the App Container dropdown
- Enter a Key and Value
- To add several at once, use Add another variable for extra rows, or Add multiple
variables to paste a list of
KEY=VALUElines and import them as rows - Click Add Variable to save
You'll see a confirmation toast (or an error if the variables couldn't be added, for example due to a reserved or duplicate key). If you close the dialog with unsaved rows, CloudRaya asks you to confirm with Leave Without Saving first.
Updating or Removing a Variable
Use the edit or delete icon next to a variable's row. Editing opens the Edit Variable dialog; deleting asks you to confirm before the variable is removed.
Changes are not applied to the running application immediately. They are staged and then applied during a redeploy.
What Triggers a Redeploy
A redeploy rebuilds the application runtime using the same application template, package size, and configuration, but with updated settings.
The following actions trigger a redeploy:
- Adding or updating environment variables
- Changing container-level configuration
- Resizing the application package
- Updating domain or routing configuration
During a redeploy:
- The application may temporarily enter a Terminating or Deploying state
- Containers are recreated with the new configuration
- The public endpoint remains the same
Secrets and Sensitive Values
Environment variables often contain sensitive information, such as:
- Database passwords
- API keys
- Application secrets
Best Practices
- Do not store secrets in plain text documents or code repositories
- Limit access to the Environment tab to trusted users
- Rotate secrets regularly
- Use strong, unique values for credentials
CloudRaya secures the underlying platform, but you are responsible for the values you store in your application configuration.
Configuration Scope
Each application can run one or more containers.
When you add an environment variable, you choose where it applies. Always check which container is selected before saving changes, so the variable is applied to the correct part of your application.
Responsibility Model
In general:
- CloudRaya is responsible for:
- Infrastructure and container platform
- Runtime availability
- You are responsible for:
- Environment variable values
- Application configuration logic
- Protecting sensitive information
Next Guide
Learn how to observe application health, stream container logs, and troubleshoot runtime issues using CloudRayaβs observability tools.