### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

- following the [installation steps](https://docs.localstack.cloud/getting-started/installation/) fails when validating localstack configuration

- error
![image](https://github.com/localstack/localstack/assets/10324554/d82ef62e-c8b8-402e-8195-e691733cfeb1)

- localstack is indeed running
![image](https://github.com/localstack/localstack/assets/10324554/44d7180a-5090-416d-afa9-c4eaaedca33e)


### Expected Behavior

- localstack can consume the path I pass `--file`

### How are you starting LocalStack?

With a docker-compose file

### Steps To Reproduce

#### How are you starting localstack (e.g., `bin/localstack` command, arguments, or `docker-compose.yml`)

    docker compose up -d
    localstack config validate --file ./compose.yaml


### Environment

```markdown
OS: Ubuntu 20.04
    LocalStack: latest
```


### Anything else?

- you can reproduce [on this branch](https://github.com/noahehall/localstack/tree/rds) if it still exists
  - else switch to the develop branch
ls_service_name = [
        name for name, svc in services_config.items() if "localstack" in svc.get("image", "")
    ]
    if not ls_service_name:
        raise Exception(
            'No LocalStack service found in config (looking for image names containing "localstack")'
        )
    if len(ls_service_name) > 1:
        warns.append(f"Multiple candidates found for LocalStack service: {ls_service_name}")
    ls_service_name = ls_service_name[0]
    ls_service_details = services_config[ls_service_name]
    image_name = ls_service_details.get("image", "")
    if image_name.split(":")[0] not in constants.OFFICIAL_IMAGES:
        warns.append(
            f'Using custom image "{image_name}", we recommend using an official image: {constants.OFFICIAL_IMAGES}'
        )
    
    container_name = ls_service_details.get("container_name") or ""
    docker_ports = (port.split(":")[-2] for port in ls_service_details.get("ports", []))
    docker_env = dict(
        (env.split("=")[0], env.split("=")[1]) for env in ls_service_details.get("environment", {})
    )
    edge_port = str(docker_env.get("EDGE_PORT") or config.EDGE_PORT)
    main_container = config.MAIN_CONTAINER_NAME
    
    if (main_container not in container_name) and not docker_env.get("MAIN_CONTAINER_NAME"):
        warns.append(
            f'Please use "container_name: {main_container}" or add "MAIN_CONTAINER_NAME" in "environment".'
        )
    def port_exposed(port):