Skip to content

Commit 8b233c7

Browse files
committed
Added ports to sandbox
1 parent 8ab7e1f commit 8b233c7

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

sdk/src/beta9/abstractions/sandbox.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ class Sandbox(Pod):
118118
# Docker daemon will be automatically started
119119
instance.docker.run("hello-world")
120120
```
121+
ports (Optional[List[int]]):
122+
List of ports to expose from the sandbox. When specified, these ports will be accessible
123+
via public URLs upon sandbox creation. Default is an empty list. You can also dynamically
124+
expose ports at runtime using `instance.expose_port(port)`.
121125
122126
Example:
123127
```python
@@ -160,6 +164,7 @@ def __init__(
160164
block_network: bool = False,
161165
allow_list: Optional[List[str]] = None,
162166
docker_enabled: bool = False,
167+
ports: Optional[List[int]] = [],
163168
):
164169
self.debug_buffer = io.StringIO()
165170
self.sync_local_dir = sync_local_dir
@@ -179,6 +184,7 @@ def __init__(
179184
block_network=block_network,
180185
allow_list=allow_list,
181186
docker_enabled=docker_enabled,
187+
ports=ports,
182188
)
183189

184190
def debug(self):

0 commit comments

Comments
 (0)