refactor: abstract traefik router labels and dynamic config
This commit is contained in:
parent
d742671460
commit
95e67dd151
9 changed files with 152 additions and 74 deletions
|
|
@ -55,6 +55,16 @@ in {
|
|||
"docker-calibre.service"
|
||||
];
|
||||
};
|
||||
homelab.traefikRouters = {
|
||||
calibre = lib.mkIf cfg.desktop.enable {
|
||||
rule = "Host(`calibre.depeuter.dev`)";
|
||||
port = 8080;
|
||||
};
|
||||
calibre-web = lib.mkIf cfg.web.enable {
|
||||
rule = "Host(`books.depeuter.dev`)";
|
||||
port = 8083;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
# Calibre desktop
|
||||
|
|
@ -102,12 +112,6 @@ in {
|
|||
|
||||
"${books}:/media/books"
|
||||
];
|
||||
labels = {
|
||||
"traefik.enable" = "true";
|
||||
"traefik.docker.network" = proxyNet;
|
||||
"traefik.http.routers.calibre.rule" = "Host(`calibre.depeuter.dev`)";
|
||||
"traefik.http.services.calibre.loadbalancer.server.port" = toString innerPort;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
|
|
@ -153,12 +157,6 @@ in {
|
|||
|
||||
"${books}:/media/books"
|
||||
];
|
||||
labels = {
|
||||
"traefik.enable" = "true";
|
||||
"traefik.docker.network" = proxyNet;
|
||||
"traefik.http.routers.calibre-web.rule" = "Host(`books.depeuter.dev`)";
|
||||
"traefik.http.services.calibre-web.loadbalancer.server.port" = toString innerPort;
|
||||
};
|
||||
};
|
||||
})
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue