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
e2bwhen following the current example stack. - If another provider is introduced later, this is the switch point in the env surface.
SANDBOX_E2B_API_KEY
- Create or copy an API key from the E2B dashboard.
- Paste it into
docker/.stack.env. - 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
- Boot the stack and trigger a sandbox-backed feature.
- Confirm new instances appear under the expected E2B account.
- Verify the template ID and cleanup behavior match the configured values.