Environments & Lifecycle Management
Learn how to manage isolated staging, production, and feature preview environments with configuration inheritance.
1. Why Multi-Environment?
Production systems require strict isolation between public traffic, staging verification, and experimental feature development.
In TurboV, an Environment is a completely isolated runtime boundary for an application:
- Has its own container instances, internal ports, and Traefik domains.
- Has its own isolated encryption keys and environment variables.
- Can be linked to dedicated staging databases or persistent storage volumes.
- Can deploy from different branches (e.g.
mainfor Production,developfor Staging).
2. Environment Inheritance
To avoid manually duplicating hundreds of environment variables between Production and Staging, TurboV supports Environment Inheritance:
Base Environment: Production
├── DATABASE_URL = postgres://prod:...
├── REDIS_URL = redis://...
├── JWT_SECRET = [PROD_SECRET]
└── STRIPE_KEY = [PROD_KEY]
│
▼ (Inherits base values)
Child Environment: Staging
├── (Inherited) JWT_SECRET
├── (Inherited) REDIS_URL
├── [OVERRIDE] DATABASE_URL = postgres://staging:...
└── [OVERRIDE] STRIPE_KEY = [STAGING_TEST_KEY]
How Inheritance Works
- Set an environment's Base Environment in settings.
- The child environment inherits all environment variables from the parent.
- Define specific overrides in the child environment for variables that must differ (e.g. staging database connection string, sandbox Stripe API keys).
- If a shared variable is updated in the base environment, child environments automatically reflect the updated value.
3. Creating a New Environment
- Open your application in the TurboV dashboard.
- In the top navigation bar, click the environment dropdown and select Create Environment.
- Configure the environment:
- Environment Name: e.g.
staging,qa,preview-v2. - Git Branch: Specify branch to track (e.g.
developorstaging). - Base Environment: (Optional) Select an existing environment to inherit variables from.
- Assigned Domain: Assign an isolated subdomain (e.g.
staging.myapp.com).
- Environment Name: e.g.
- Click Create & Deploy.
4. Promoting Deployments Between Environments
Once a release has passed QA in your staging environment, you can promote it to production:
- Navigate to your application's Deployments tab.
- Find the verified deployment in your staging environment.
- Click Promote to Environment → Select Production.
- TurboV triggers a production blue-green deployment using the exact verified Git commit hash and Docker image tag, ensuring what you tested is what runs in production.
5. Environment Teardown & Deletion Safety
Deleting an environment cleanly tears down all associated resources:
- Drains and terminates all running service containers.
- Purges dynamic Traefik routing configuration manifests from
/var/lib/turbov/traefik/dynamic/. - Traefik automatically removes SSL routes without restarting.
- Cleans up ephemeral build files.
- (Optional) Retains or purges linked persistent volumes based on your deletion confirmation settings.