Skip to content

Commit a1ec9bb

Browse files
committed
changeset
1 parent b605adc commit a1ec9bb

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.changeset/chatty-doors-shake.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
"wrangler": minor
3+
---
4+
5+
Enable using `ctx.exports` with containers
6+
7+
You can now use containers with Durable Objects that are accessed via [`ctx.exports`](https://developers.cloudflare.com/workers/runtime-apis/context/#exports).
8+
9+
Now your config file can look something like this:
10+
11+
```
12+
{
13+
"name": "container-app",
14+
"main": "src/index.ts",
15+
"compatibility_date": "2025-12-01",
16+
"compatibility_flags": ["enable_ctx_exports"], // compat flag needed for now.
17+
"containers": [
18+
{
19+
"image": "./Dockerfile",
20+
"class_name": "MyDOClassname",
21+
"name": "my-container"
22+
},
23+
],
24+
"migrations": [
25+
{
26+
"tag": "v1",
27+
"new_sqlite_classes": ["MyDOClassname"],
28+
},
29+
],
30+
// no need to declare your durable object binding here
31+
}
32+
```
33+
34+
Note that when using `ctx.exports`, where you previously accessed a Durable Object via something like `env.DO`, you should now access with `ctx.exports.MyDOClassname`.
35+
36+
Refer to [the docs for more information on using `ctx.exports`](https://developers.cloudflare.com/workers/runtime-apis/context/#exports).

0 commit comments

Comments
 (0)