You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Miscellaneous minor fixes and improvements to starting containers and port checking.
6
+
7
+
- When calling `startAndWaitForPorts`, check for port-readiness even if the container is started.
8
+
9
+
- Add `waitForPort()` method.
10
+
11
+
- Add options to configure timeout and polling interval to `start`, similar to what `cancellationOptions` on `startAndWaitForPorts`. `start` does not check for port readiness but still polls for available and starting container.
12
+
13
+
- Respect `waitInterval` if passed in via `start` or `startAndWaitForPorts` when polling container for readiness.
// After 1 minute of no new activity, shutdown the container
27
28
sleepAfter ='1m';
28
29
}
29
30
@@ -57,12 +58,35 @@ The `Container` class that extends a container-enbled Durable Object to provide
57
58
58
59
#### Properties
59
60
60
-
-`defaultPort?`: Optional default port to use when communicating with the container. If not set, you must specify port like `fetch(switchPort(req, 8080))` or `containerFetch(req, 8080)`.
61
-
-`requiredPorts?`: Array of ports that should be checked for availability during container startup. Used by `startAndWaitForPorts` when no specific ports are provided.
62
-
-`sleepAfter`: How long to keep the container alive without activity (format: number for seconds, or string like "5m", "30s", "1h")
63
-
-`env`: Environment variables to pass to the container (Record<string, string>) when starting up. These are the defaults but can be overriden on a per-instance basis when starting.
64
-
-`entrypoint?`: Custom entrypoint to override container default (string[]). These are the defaults but can be overriden on a per-instance basis when starting.
65
-
-`enableInternet`: Whether to enable internet access for the container (boolean, default: `true`). These are the defaults but can be overriden on a per-instance basis when starting.
61
+
-`defaultPort?`
62
+
63
+
Optional default port to use when communicating with the container. If this is not set, or you want to target a specific port on your container, you can specify the port with `fetch(switchPort(req, 8080))` or `containerFetch(req, 8080)`.
64
+
65
+
-`requiredPorts?`
66
+
67
+
Array of ports that should be checked for availability during container startup. Used by `startAndWaitForPorts` when no specific ports are provided.
68
+
69
+
-`sleepAfter`
70
+
71
+
How long to keep the container alive without activity (format: number for seconds, or string like "5m", "30s", "1h").
72
+
73
+
Defaults to "10m", meaning that after the Container class Durable Object receives no requests for 10 minutes, it will shut down the container.
74
+
75
+
The following properties are used to set defaults when starting the container, but can be overriden on a per-instance basis by passing in values to `startAndWaitForPorts()` or `start()`.
76
+
77
+
-`env?: Record<string, string>`
78
+
79
+
Environment variables to pass to the container when starting up.
80
+
81
+
-`entrypoint?: string[]`
82
+
83
+
Specify an entrypoint to override image default.
84
+
85
+
-`enableInternet: boolean`
86
+
87
+
Whether to enable internet access for the container.
0 commit comments