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. main for Production, develop for 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

  1. Set an environment's Base Environment in settings.
  2. The child environment inherits all environment variables from the parent.
  3. Define specific overrides in the child environment for variables that must differ (e.g. staging database connection string, sandbox Stripe API keys).
  4. If a shared variable is updated in the base environment, child environments automatically reflect the updated value.

3. Creating a New Environment

  1. Open your application in the TurboV dashboard.
  2. In the top navigation bar, click the environment dropdown and select Create Environment.
  3. Configure the environment:
    • Environment Name: e.g. staging, qa, preview-v2.
    • Git Branch: Specify branch to track (e.g. develop or staging).
    • Base Environment: (Optional) Select an existing environment to inherit variables from.
    • Assigned Domain: Assign an isolated subdomain (e.g. staging.myapp.com).
  4. Click Create & Deploy.

4. Promoting Deployments Between Environments

Once a release has passed QA in your staging environment, you can promote it to production:

  1. Navigate to your application's Deployments tab.
  2. Find the verified deployment in your staging environment.
  3. Click Promote to Environment → Select Production.
  4. 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.