### 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_
domain_name = f"opensearch-domain-{short_uid()}"
        try:
            domain_status = opensearch_client.create_domain(DomainName=domain_name)["DomainStatus"]
            response = opensearch_client.list_domain_names(EngineType="OpenSearch")
            domain_names = [domain["DomainName"] for domain in response["DomainNames"]]
            assert domain_name in domain_names
            
            opensearch_wait_for_cluster(domain_name=domain_name)
            
            plugins_url = (
                f"https://{domain_status['Endpoint']}/_cat/plugins?s=component&h=component"
            )
            plugins_response = requests.get(plugins_url, headers={"Accept": "application/json"})
            installed_plugins = set(plugin["component"] for plugin in plugins_response.json())
            requested_plugins = set(OPENSEARCH_PLUGIN_LIST)
            assert requested_plugins.issubset(installed_plugins)
        finally:
            opensearch_client.delete_domain(DomainName=domain_name)
    @pytest.mark.aws_validated
    def test_create_domain_with_invalid_name(self, opensearch_client):
        with pytest.raises(botocore.exceptions.ClientError) as e:
            opensearch_client.create_domain(
                DomainName="123abc"
            )  
        assert e.value.response["Error"]["Code"] == "ValidationException"
        with pytest.raises(botocore.exceptions.ClientError) as e:
            opensearch_client.create_domain(DomainName="abc#")  
        assert e.value.response["Error"]["Code"] == "ValidationException"
    @pytest.mark.aws_validated
    def test_exception_header_field(self, opensearch_client):