Skip to main content

Sandbox Provider Configuration

The Docker stack example uses E2B-backed sandboxes. These variables define which provider to use, how to authenticate, and which template/runtime should be provisioned.

SANDBOX_PROVIDER

  • Set this to e2b when following the current example stack.
  • If another provider is introduced later, this is the switch point in the env surface.

SANDBOX_E2B_API_KEY

  1. Create or copy an API key from the E2B dashboard.
  2. Paste it into docker/.stack.env.
  3. Keep it out of source control.

SANDBOX_E2B_TEMPLATE_ID

  • This selects the E2B template or base image used for sandbox creation.
  • The example file defaults to base, but production or staging stacks may use a custom template.

SANDBOX_TIME_TIL_CLEAN_UP

  • Specifies how long (in seconds) an idle sandbox lives before auto-shutdown.
  • Choose a value that balances cost and usability. Example: 900 (15 minutes) keeps sessions alive long enough for debugging without leaving unused containers running.

Validation Checklist

  1. Boot the stack and trigger a sandbox-backed feature.
  2. Confirm new instances appear under the expected E2B account.
  3. Verify the template ID and cleanup behavior match the configured values.