diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index f9bbeaa2..97e9ba6c 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -65,6 +65,7 @@ export default defineConfig({ { text: "Actions", link: "/guide/actions" }, { text: "Agent Mode", link: "/guide/agent" }, { text: "Changing Base", link: "/guide/changing-base" }, + { text: "Container Groups", link: "/guide/container-groups" }, { text: "Data Analytics", link: "/guide/analytics" }, { text: "Display Name", link: "/guide/hostname" }, { text: "Filters", link: "/guide/filters" }, diff --git a/docs/guide/container-groups.md b/docs/guide/container-groups.md new file mode 100644 index 00000000..657ee470 --- /dev/null +++ b/docs/guide/container-groups.md @@ -0,0 +1,34 @@ +--- +title: Container Groups +--- + +# Container Groups + +Dozzle performs automatic grouping of containers based on their stack name or service name. You can also create custom groups using labels. + +## Default Groups + +By default, containers are grouped by their stack name in host mode. If `com.docker.swarm.service.name` label is present, Dozzle will automatically enable a "swarm mode" where all containers with the same service name will be joined together. + +## Custom Groups + +Additionally, you can create custom groups by adding a label to your container. The label is `dev.dozzle.group` and the value is the name of the group. All containers with the same group name will be joined together in the UI. For example, if you have a group named `myapp`, all containers with the label `dozzle.group=myapp` will be joined together. + +Here is an example using Docker Compose or Docker CLI: + +::: code-group + +```sh +docker run --label dev.dozzle.group=myapp hello-world +``` + +```yaml [docker-compose.yml] +version: "3" +services: + dozzle: + image: hello-world + labels: + - dev.dozzle.group=myapp +``` + +::: diff --git a/docs/guide/swarm-mode.md b/docs/guide/swarm-mode.md index 0dc0c668..4281d049 100644 --- a/docs/guide/swarm-mode.md +++ b/docs/guide/swarm-mode.md @@ -37,25 +37,37 @@ 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. -## Custom Groups +## Setting up simple authentication in Swarm Mode -Custom groups are created by adding a label to your container. The label is `dev.dozzle.group` and the value is the name of the group. All containers with the same group name will be joined together in the UI. For example, if you have a group named `myapp`, all containers with the label `dozzle.group=myapp` will be joined together. +To setup simple authentication, you can use Docker secrets to store `users.yml` file. Here is an example using Docker Stack: -Here is an example using Docker Compose or Docker CLI: - -::: code-group - -```sh -docker run --label dev.dozzle.group=myapp hello-world -``` - -```yaml [docker-compose.yml] -version: "3" +```yml services: dozzle: - image: hello-world - labels: - - dev.dozzle.group=myapp + image: amir20/dozzle:latest + environment: + - DOZZLE_LEVEL=debug + - DOZZLE_MODE=swarm + - DOZZLE_AUTH_PROVIDER=simple + volumes: + - /var/run/docker.sock:/var/run/docker.sock + secrets: + - source: users + target: /data/users.yml + + ports: + - "8080:8080" + networks: + - dozzle + deploy: + mode: global + +networks: + dozzle: + driver: overlay +secrets: + users: + file: users.yml ``` -::: +In this example, `users.yml` file is stored in a Docker secret. It is the same as the [simple authentication](/guide/authentication#generating-users-yml) example.