Repository: amir20/dozzle (language: go)

Issue:
Globally Deployed Dozzle With Swarm Mode Needs the service to be named dozzle or it doesn't work
**Describe the bug**
If you name the service in the stack anything other than dozzle you get 
```
level=fatal msg="error looking up swarm services: lookup tasks.dozzle on 127.0.0.11:53: no such host"

```

**To Reproduce**
Make a service with a different name than dozzle, like dozzleme and this issue occurs

**Expected behavior**
It to work regardless of the service name

**Desktop (please complete the following information):**

- OS: Ubuntu
- Docker version 26.1.4
- Browser & version N/A
- Version 8.0.1


My config for refrence
```
services:
  dozzleme:
    image: dockreg.biswb.com:5000/amir20-dozzle:070824
    environment:
      DOZZLE_MODE: swarm
      DOZZLE_AUTH_PROVIDER: simple
    networks:
      - DockInternalComms      
    volumes:
      - data:/data
      - /var/run/docker.sock:/var/run/docker.sock:ro
    deploy:
      mode: global
      update_config:
        delay: 20s
        failure_action: rollback     

networks:
  DockInternalComms:
    external: true
```



Discussion / hints:
Yep. +1. I think I have to look myself up using Docker API by ID and get service name. But it was too much work. 

Not sure if I will get to it soon. If you can update the docs with a tip or something I would really appreciate it. 
I tried doing an edit here

https://dozzle.dev/guide/swarm-mode

It says I need to fork it first, which doesn't seem like what we are trying to do
Yes, you need to fork and send a PR. 
ah, well I am revealed then, that is not something I actually have done before or know how to do. Happy to do it if you want to guide me, also can understand if you don't have the time for that. 

Fix patch:
diff --git a/docs/guide/supported-env-vars.md b/docs/guide/supported-env-vars.md
index 68d2ecd035c8..9ce5797204e7 100644
--- a/docs/guide/supported-env-vars.md
+++ b/docs/guide/supported-env-vars.md
@@ -6,18 +6,17 @@ title: Environment variables and configuration
 
 Configurations can be done with flags or environment variables. The table below outlines all supported options and their respective env vars.
 
-| Flag                        | Env Variable                     | Default        |
-| --------------------------- | -------------------------------- | -------------- |
-| `--addr`                    | `DOZZLE_ADDR`                    | `:8080`        |
-| `--base`                    | `DOZZLE_BASE`                    | `/`            |
-| `--hostname`                | `DOZZLE_HOSTNAME`                | `""`           |
-| `--level`                   | `DOZZLE_LEVEL`                   | `info`         |
-| `--auth-provider`           | `DOZZLE_AUTH_PROVIDER`           | `none`         |
-| `--auth-header-user`        | `DOZZLE_AUTH_HEADER_USER`        | `Remote-User`  |
-| `--auth-header-email`       | `DOZZLE_AUTH_HEADER_EMAIL`       | `Remote-Email` |
-| `--auth-header-name`        | `DOZZLE_AUTH_HEADER_NAME`        | `Remote-Name`  |
-| `--enable-actions`          | `DOZZLE_ENABLE_ACTIONS`          | false          |
-| `--wait-for-docker-seconds` | `DOZZLE_WAIT_FOR_DOCKER_SECONDS` | 0              |
-| `--filter`                  | `DOZZLE_FILTER`                  | `""`           |
-| `--no-analytics`            | `DOZZLE_NO_ANALYTICS`            | false          |
-| `--remote-host`             | `DOZZLE_REMOTE_HOST`             |                |
+| Flag                  | Env Variable               | Default        |
+| --------------------- | -------------------------- | -------------- |
+| `--addr`              | `DOZZLE_ADDR`              | `:8080`        |
+| `--base`              | `DOZZLE_BASE`              | `/`            |
+| `--hostname`          | `DOZZLE_HOSTNAME`          | `""`           |
+| `--level`             | `DOZZLE_LEVEL`             | `info`         |
+| `--auth-provider`     | `DOZZLE_AUTH_PROVIDER`     | `none`         |
+| `--auth-header-user`  | `DOZZLE_AUTH_HEADER_USER`  | `Remote-User`  |
+| `--auth-header-email` | `DOZZLE_AUTH_HEADER_EMAIL` | `Remote-Email` |
+| `--auth-header-name`  | `DOZZLE_AUTH_HEADER_NAME`  | `Remote-Name`  |
+| `--enable-actions`    | `DOZZLE_ENABLE_ACTIONS`    | false          |
+| `--filter`            | `DOZZLE_FILTER`            | `""`           |
+| `--no-analytics`      | `DOZZLE_NO_ANALYTICS`      | false          |
+| `--remote-host`       | `DOZZLE_REMOTE_HOST`       |                |
diff --git a/docs/guide/swarm-mode.md b/docs/guide/swarm-mode.md
index 4281d0496454..826c40172981 100644
--- a/docs/guide/swarm-mode.md
+++ b/docs/guide/swarm-mode.md
@@ -37,6 +37,9 @@ networks:
 
 Note that the `DOZZLE_MODE` environment variable is set to `swarm`. This tells Dozzle to automatically discover other Dozzle instances in the swarm. The `overlay` network is used to create the mesh network between the different Dozzle instances.
 
+> [!NOTE]
+> Due to implementation details, the name for the service must be exactly `dozzle`. This is because Dozzle uses the service name to discover other Dozzle instances in the swarm. In the future, it would make sense to query the Docker API for all services with the current container ID.
+
 ## Setting up simple authentication in Swarm Mode
 
 To setup simple authentication, you can use Docker secrets to store `users.yml` file. Here is an example using Docker Stack:


Test patch: