Configure Durable Objects bindings, container images, and Worker settings in wrangler.jsonc.
Configuration
Configure your Sandbox SDK deployment with Wrangler, customize container images, and manage environment variables.
Customize the sandbox container image with your own packages, tools, and configurations.
Pass configuration and secrets to your sandboxes using environment variables.
{ "name": "my-worker", "main": "src/index.ts", "compatibility_date": "2024-09-02", "compatibility_flags": ["nodejs_compat"], "durable_objects": { "bindings": [ { "name": "Sandbox", "class_name": "Sandbox", "script_name": "@cloudflare/sandbox" } ] }, "containers": [ { "binding": "CONTAINER", "image": "ghcr.io/cloudflare/sandbox-runtime:latest" } ]}
FROM ghcr.io/cloudflare/sandbox-runtime:latest
# Install additional Python packagesRUN pip install scikit-learn tensorflow pandas
# Install Node.js packages globallyRUN npm install -g typescript ts-node
# Install system packagesRUN apt-get update && apt-get install -y postgresql-client
# Add custom scriptsCOPY ./scripts /usr/local/bin/
// Pass to sandbox at creationconst sandbox = getSandbox(env.Sandbox, 'my-sandbox');
// Configure environment for commandsawait sandbox.exec('node app.js', { env: { NODE_ENV: 'production', API_KEY: env.API_KEY, DATABASE_URL: env.DATABASE_URL }});
- Get Started guide - Initial setup walkthrough
- Wrangler documentation - Complete Wrangler reference
- Docker documentation ↗ - Dockerfile syntax
- Security model - Understanding environment isolation
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Directory
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark
-