Begin Dendritic rewrite
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
{ config, lib, ... }: let
|
||||
{ ... }: {
|
||||
|
||||
flake.nixosModules.default = { config, lib, ... }: let
|
||||
|
||||
hostPort = 9000;
|
||||
|
||||
@@ -6,57 +8,58 @@
|
||||
|
||||
name = "portainer";
|
||||
|
||||
in {
|
||||
in {
|
||||
|
||||
options.sysconfig.docker.portainer.enable = with lib; mkOption {
|
||||
type = with types; bool;
|
||||
default = true;
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.sysconfig.docker.portainer.enable && config.sysconfig.docker.enable) {
|
||||
|
||||
networking.firewall.interfaces = {
|
||||
"ve-traefik" = {
|
||||
allowedTCPPorts = [ hostPort ];
|
||||
};
|
||||
options.sysconfig.docker.portainer.enable = with lib; mkOption {
|
||||
type = with types; bool;
|
||||
default = true;
|
||||
};
|
||||
|
||||
virtualisation.oci-containers.containers.portainer = {
|
||||
image = "portainer/portainer-ce:latest";
|
||||
config = lib.mkIf (config.sysconfig.docker.portainer.enable && config.sysconfig.docker.enable) {
|
||||
|
||||
# unstable, waiting for 26.05
|
||||
#pull = "newer";
|
||||
|
||||
hostname = "${subdomain}.esotericbytes.com";
|
||||
|
||||
networks = [
|
||||
"docker-main"
|
||||
];
|
||||
|
||||
labels = {
|
||||
"traefik.enable" = "true";
|
||||
"traefik.http.routers.${name}.entrypoints" = "localsecure";
|
||||
"traefik.http.routers.${name}.rule" = "Host(`${subdomain}.esotericbytes.com`)";
|
||||
"traefik.http.routers.${name}.service" = "${name}";
|
||||
"traefik.http.routers.${name}.tls.certResolver" = "cloudflare";
|
||||
|
||||
#"traefik.http.services.${name}.loadbalancer.server.url" = "http://192.168.100.10:${builtins.toString hostPort}";
|
||||
"traefik.http.services.${name}.loadbalancer.server.port" = "9000";
|
||||
networking.firewall.interfaces = {
|
||||
"ve-traefik" = {
|
||||
allowedTCPPorts = [ hostPort ];
|
||||
};
|
||||
};
|
||||
|
||||
ports = [
|
||||
"127.0.0.1:8000:8000"
|
||||
"${builtins.toString hostPort}:9000"
|
||||
];
|
||||
|
||||
extraOptions = [
|
||||
"--ip=192.168.101.10"
|
||||
];
|
||||
virtualisation.oci-containers.containers.portainer = {
|
||||
image = "portainer/portainer-ce:latest";
|
||||
|
||||
volumes = [
|
||||
"vol_portainer:/data"
|
||||
"/run/docker.sock:/var/run/docker.sock"
|
||||
];
|
||||
# unstable, waiting for 26.05
|
||||
#pull = "newer";
|
||||
|
||||
hostname = "${subdomain}.esotericbytes.com";
|
||||
|
||||
networks = [
|
||||
"docker-main"
|
||||
];
|
||||
|
||||
labels = {
|
||||
"traefik.enable" = "true";
|
||||
"traefik.http.routers.${name}.entrypoints" = "localsecure";
|
||||
"traefik.http.routers.${name}.rule" = "Host(`${subdomain}.esotericbytes.com`)";
|
||||
"traefik.http.routers.${name}.service" = "${name}";
|
||||
"traefik.http.routers.${name}.tls.certResolver" = "cloudflare";
|
||||
|
||||
#"traefik.http.services.${name}.loadbalancer.server.url" = "http://192.168.100.10:${builtins.toString hostPort}";
|
||||
"traefik.http.services.${name}.loadbalancer.server.port" = "9000";
|
||||
};
|
||||
|
||||
ports = [
|
||||
"127.0.0.1:8000:8000"
|
||||
"${builtins.toString hostPort}:9000"
|
||||
];
|
||||
|
||||
extraOptions = [
|
||||
"--ip=192.168.101.10"
|
||||
];
|
||||
|
||||
volumes = [
|
||||
"vol_portainer:/data"
|
||||
"/run/docker.sock:/var/run/docker.sock"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user