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
|
|
@ -37,6 +37,13 @@ in {
|
|||
];
|
||||
};
|
||||
|
||||
homelab.traefikRouters.homepage = let
|
||||
host = "homepage.${config.networking.domain}";
|
||||
in {
|
||||
rule = "Host(`${host}`)";
|
||||
port = cfg.port;
|
||||
};
|
||||
|
||||
virtualisation.oci-containers.containers.homepage = let
|
||||
host = "homepage.${config.networking.domain}";
|
||||
in {
|
||||
|
|
@ -54,12 +61,6 @@ in {
|
|||
"${homepage-config}:/app/config"
|
||||
# "/var/run/docker.sock:/var/run/docker.sock:ro" # For docker integrations
|
||||
];
|
||||
labels = {
|
||||
"traefik.enable" = "true";
|
||||
"traefik.docker.network" = proxyNet;
|
||||
"traefik.http.routers.homepage.rule" = "Host(`${host}`)";
|
||||
"traefik.http.services.homepage.loadbalancer.server.port" = toString cfg.port;
|
||||
};
|
||||
environment = {
|
||||
inherit PUID PGID;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue