summaryrefslogtreecommitdiff
path: root/modules/server/virtualisation/containers/dozzle.nix
blob: 5a751055cce65b742911bcdf041bf2e03677eb25 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ config, ... }:
let
  port = builtins.toString 8091;
in
{
  services.caddy.virtualHosts."dozzle.kansai.cloud".extraConfig = "reverse_proxy localhost:${port}";

  virtualisation.oci-containers.containers.dozzle = {
    inherit (config.modules.containers) extraOptions;

    image = "amir20/dozzle:latest";
    autoStart = true;
    ports = [ "127.0.0.1:${port}:8080" ];

    cmd = [
      "--auth-provider=simple"
      "--auth-ttl=48h"
    ];

    volumes =
      let
        hostSocket =
          if config.modules.containers.engine == "podman" then
            "/run/podman/podman.sock"
          else
            "/var/run/docker.sock";
      in
      [
        "${hostSocket}:/var/run/docker.sock"
        "/mnt/docker/dozzle:/data/"
      ];
  };
}