From 679df0fb1cdf4099650698c724a704e9846ab59a Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Thu, 26 Sep 2024 20:44:51 +0300 Subject: [PATCH] feat: host websites on oci instead of old portainer --- systems/hosts/oci/default.nix | 4 ++++ systems/hosts/oci/websites.nix | 31 +++++++++++++++++++++++++++++++ systems/hosts/proxy/haproxy.conf | 4 ++-- 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 systems/hosts/oci/websites.nix diff --git a/systems/hosts/oci/default.nix b/systems/hosts/oci/default.nix index 8c5b4f6..cc5522d 100644 --- a/systems/hosts/oci/default.nix +++ b/systems/hosts/oci/default.nix @@ -2,6 +2,10 @@ registryPort = 5000; registryUIPort = 5080; in { + imports = [ + ./websites.nix + ]; + networking.firewall.allowedTCPPorts = [ registryPort registryUIPort diff --git a/systems/hosts/oci/websites.nix b/systems/hosts/oci/websites.nix new file mode 100644 index 0000000..fd8e7f8 --- /dev/null +++ b/systems/hosts/oci/websites.nix @@ -0,0 +1,31 @@ +{...}: let + comPort = 8080; + devPort = 8081; +in { + networking.firewall.allowedTCPPorts = [ + comPort + devPort + ]; + + virtualisation.oci-containers.containers."liljamo-com-zola" = { + image = "localhost:5000/liljamo/liljamo-com-zola:latest"; + extraOptions = [ + "--tls-verify=false" + ]; + hostname = "liljamo-com-zola"; + ports = [ + "${toString comPort}:80" + ]; + }; + + virtualisation.oci-containers.containers."liljamo-dev-zola" = { + image = "localhost:5000/liljamo/liljamo-dev-zola:latest"; + hostname = "liljamo-dev-zola"; + extraOptions = [ + "--tls-verify=false" + ]; + ports = [ + "${toString devPort}:80" + ]; + }; +} diff --git a/systems/hosts/proxy/haproxy.conf b/systems/hosts/proxy/haproxy.conf index e7d69bd..ee15de8 100644 --- a/systems/hosts/proxy/haproxy.conf +++ b/systems/hosts/proxy/haproxy.conf @@ -60,7 +60,7 @@ backend be_caddy-https # liljamo.com backend be_liljamocom - server liljamocom 10.1.1.10:8100 + server liljamocom 10.1.2.9:8080 backend be_liljamocom_webfinger server liljamocomwebfinger 10.1.2.12:80 @@ -96,7 +96,7 @@ backend be_lothlorien_matrix # liljamo.dev backend be_liljamodev - server liljamodev 10.1.1.10:8110 + server liljamodev 10.1.2.9:8081 backend be_registry server registry 10.1.1.10:5000 -- 2.44.1