### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

I am using below docker-compose file to start the localstack container with es service
```
version: "3"
services:
  wiremock:
    image: "rodolpheche/wiremock"
    ports:
      - "8080"
  localstack:
    image: "localstack/localstack-full:0.14.2"
    ports:
      - "4566"
      - "4510:4510"
    environment:
      AWS_ACCESS_KEY_ID: "local-access-key-id"
      AWS_SECRET_ACCESS_KEY: "local-secret-access-key"
      HOSTNAME_EXTERNAL: "localstack"
      OPENSEARCH_ENDPOINT_STRATEGY: "port"
      SERVICES: "es"
      EDGE_PORT: "4566"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"

```

running `aws --region ap-south-1 --endpoint-url http://localstack:4566 es create-elasticsearch-domain --domain-name my-domain` to create domain
this command is returning `localhost:4510` as an endpoint, I am able to curl `curl localhost:4510` within localstack bash but 
neither on the host machine nor in `wiremock` container.



### Expected Behavior

I should able to access elastic search domain in host machine as well in another container

### How are you starting LocalStack?

With a docker-compose file

### Steps To Reproduce

#### How are you starting localstack

 ```
version: "3"
services:
  wiremock:
    image: "rodolpheche/wiremock"
    ports:
      - "8080"
  localstack:
    image: "localstack/localstack-full:0.14.2"
    ports:
      - "4566"
      - "4510:4510"
    environment:
      AWS_ACCESS_KEY_ID: "local-access-key-id"
      AWS_SECRET_ACCESS_KEY: "local-secret-access-key"
      HOSTNAME_EXTERNAL: "localstack"
      OPENSEARCH_ENDPOINT_STRATEGY: "port"
      SERVICES: "es"
      EDGE_PORT: "4566"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"

```

#### Client commands

    aws --region ap-south-1 --endpoint-url http://localstack:4566 es create-elasticsearch-domain --domain-name my-domain


### Environment

```markdown
- OS:
- LocalStack:
```


### Anything else?

_No response_
"""
    Determines directories to find the opensearch binary as well as where to store the instance data.
    :param version: the full OpenSearch/Elasticsearch version (to resolve the install dir)
    :param cluster_path: the path between data_root and the actual data directories
    :param data_root: the root of the data dir (will be resolved to TMP_PATH or DATA_DIR by default)
    :returns: a Directories data structure
    """
    
    engine_type, install_version = versions.get_install_type_and_version(version)
    if engine_type == EngineType.OpenSearch:
        install_dir = install.get_opensearch_install_dir(install_version)
    else:
        
        install_dir = install.get_elasticsearch_install_dir(install_version)
    modules_dir = os.path.join(install_dir, "modules")
    if not data_root:
        data_root = config.dirs.data or config.dirs.tmp
    if engine_type == EngineType.OpenSearch:
        data_path = os.path.join(data_root, "opensearch", cluster_path)
    else:
        data_path = os.path.join(data_root, "elasticsearch", cluster_path)
    tmp_dir = os.path.join(data_path, "tmp")
    data_dir = os.path.join(data_path, "data")
    backup_dir = os.path.join(data_path, "backup")
    return Directories(install_dir, tmp_dir, modules_dir, data_dir, backup_dir)
def build_cluster_run_command(cluster_bin: str, settings: CommandSettings) -> List[str]: