Adding environment variables
You can define environment variables while creating or updating a deployment:- Go to your Environment Dashboard → select your service.
- add service and add Environment Variables, click Add Variable.
- Provide a key and value.
- Save changes and redeploy for updates to take effect.
.env file directly using the .ENV button in the form. DCDeploy will automatically parse and add the variables.
Secrets management
Sensitive values (e.g., database passwords, API keys) should be stored as secrets. DCDeploy automatically encrypts them and injects them at runtime. Example:
Overriding variables
- Variables defined in the dashboard UI override those in the manifest.
- Redeployment is required for changes to apply.
- Deleted variables are removed from the runtime environment on next deploy.
Best practices
- Never hard-code secrets in images or code.
- Use different env files for dev, staging, and production.
- Prefix variables for clarity (e.g.,
DB_HOST,REDIS_URL). - Keep non-secret configs (like
LOG_LEVEL) separate from sensitive ones.
