Skip to content

Commit 55b007f

Browse files
Use single instance when deploying minimal example (#128)
1 parent f25e9db commit 55b007f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

examples/minimal/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ FROM docker.io/cloudflare/sandbox:0.4.4
22

33
# On a Mac with Apple Silicon, you might need to specify the platform:
44
# FROM --platform=linux/arm64 docker.io/cloudflare/sandbox:0.4.4
5+
6+
# Required during local development to access exposed ports
7+
EXPOSE 8080

examples/minimal/src/index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getSandbox, proxyToSandbox, type Sandbox } from "@cloudflare/sandbox";
1+
import { getSandbox, type Sandbox } from "@cloudflare/sandbox";
22

33
export { Sandbox } from "@cloudflare/sandbox";
44

@@ -8,10 +8,6 @@ type Env = {
88

99
export default {
1010
async fetch(request: Request, env: Env): Promise<Response> {
11-
// Required for preview URLs (if you expose ports later)
12-
const proxyResponse = await proxyToSandbox(request, env);
13-
if (proxyResponse) return proxyResponse;
14-
1511
const url = new URL(request.url);
1612

1713
// Get or create a sandbox instance

examples/minimal/wrangler.jsonc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
{
1212
"class_name": "Sandbox",
1313
"image": "./Dockerfile",
14-
"instance_type": "basic"
14+
"instance_type": "lite",
15+
"max_instances": 1
1516
}
1617
],
1718
"durable_objects": {

0 commit comments

Comments
 (0)