Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Update docker_runtime.py #8422 (#8423)

Muly Ovedda637a0dad54
diff --git a/openhands/runtime/impl/docker/docker_runtime.py b/openhands/runtime/impl/docker/docker_runtime.py
index c3c3b243b8..883877cafe 100644
--- a/openhands/runtime/impl/docker/docker_runtime.py
+++ b/openhands/runtime/impl/docker/docker_runtime.py
@@ -489,8 +489,9 @@ class DockerRuntime(ActionExecutionClient):
def web_hosts(self):
hosts: dict[str, int] = {}
+ host_addr = os.environ.get('DOCKER_HOST_ADDR', 'localhost')
for port in self._app_ports:
- hosts[f'http://localhost:{port}'] = port
+ hosts[f'http://{host_addr}:{port}'] = port
return hosts