+ portUtils +metabase
This commit is contained in:
@@ -1,25 +1,34 @@
|
||||
{config, ...}: {
|
||||
virtualisation.oci-containers.containers."baserow" = {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
serviceName = "baserow";
|
||||
portUtils = import ../../../../lib/port-utils.nix {inherit lib;};
|
||||
servicePort = portUtils.getPort serviceName "AZ-CLD-1";
|
||||
in {
|
||||
virtualisation.oci-containers.containers.${serviceName} = {
|
||||
image = "docker.io/baserow/baserow:1.34.5";
|
||||
environmentFiles = [config.age.secrets.baserow-env.path];
|
||||
ports = ["127.0.0.1:3050:80"];
|
||||
ports = ["127.0.0.1:${toString servicePort}:80"];
|
||||
volumes = ["baserow_data:/baserow/data"];
|
||||
extraOptions = ["--add-host=postgres:10.89.0.1" "--ip=10.89.0.10" "--network=web"];
|
||||
};
|
||||
# Traefik configuration specific to baserow
|
||||
|
||||
# Traefik configuration
|
||||
services.traefik.dynamicConfigOptions.http = {
|
||||
services.baserow.loadBalancer.servers = [
|
||||
services.${serviceName}.loadBalancer.servers = [
|
||||
{
|
||||
url = "http://localhost:3050/";
|
||||
url = "http://localhost:${toString servicePort}/";
|
||||
}
|
||||
];
|
||||
|
||||
routers.baserow = {
|
||||
routers.${serviceName} = {
|
||||
rule = "Host(`br.az-gruppe.com`)";
|
||||
tls = {
|
||||
certResolver = "ionos";
|
||||
};
|
||||
service = "baserow";
|
||||
service = serviceName;
|
||||
entrypoints = "websecure";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
serviceName = "librechat-dev";
|
||||
portUtils = import ../../../../lib/port-utils.nix {inherit lib;};
|
||||
servicePort = portUtils.getPort serviceName "AZ-CLD-1";
|
||||
ragApiDevPort = portUtils.getPort "rag-api-dev" "AZ-CLD-1";
|
||||
envFileDev = config.age.secrets.librechat-env-dev.path;
|
||||
in {
|
||||
virtualisation.oci-containers = {
|
||||
@@ -29,7 +34,7 @@ in {
|
||||
environmentFiles = [envFileDev];
|
||||
dependsOn = ["meilisearch-dev"];
|
||||
extraOptions = ["--add-host=postgres:10.89.1.1" "--ip=10.89.1.21" "--network=web-dev"];
|
||||
ports = ["127.0.0.1:8100:8000"];
|
||||
ports = ["127.0.0.1:${toString ragApiDevPort}:8000"];
|
||||
};
|
||||
|
||||
containers.mongodb-dev = {
|
||||
@@ -42,10 +47,10 @@ in {
|
||||
extraOptions = ["--ip=10.89.1.22" "--network=web-dev"];
|
||||
};
|
||||
|
||||
containers.librechat-dev = {
|
||||
containers.${serviceName} = {
|
||||
image = "ghcr.io/danny-avila/librechat-dev-api:latest";
|
||||
autoStart = false;
|
||||
ports = ["127.0.0.1:3141:3080"];
|
||||
ports = ["127.0.0.1:${toString servicePort}:3080"];
|
||||
dependsOn = ["mongodb-dev" "rag_api-dev" "meilisearch-dev"];
|
||||
environment = {
|
||||
HOST = "0.0.0.0";
|
||||
@@ -66,15 +71,24 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
# Traefik configuration
|
||||
services.traefik.dynamicConfigOptions.http = {
|
||||
services.librechat-dev.loadBalancer.servers = [{url = "http://localhost:3141/";}];
|
||||
routers.librechat-dev = {
|
||||
services.${serviceName}.loadBalancer.servers = [
|
||||
{
|
||||
url = "http://localhost:${toString servicePort}/";
|
||||
}
|
||||
];
|
||||
|
||||
routers.${serviceName} = {
|
||||
rule = "Host(`chat-dev.az-gruppe.com`)";
|
||||
tls.certResolver = "ionos";
|
||||
service = "librechat-dev";
|
||||
tls = {
|
||||
certResolver = "ionos";
|
||||
};
|
||||
service = serviceName;
|
||||
entrypoints = "websecure";
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellScriptBin "librechat-dev" ''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
serviceName = "librechat";
|
||||
portUtils = import ../../../../lib/port-utils.nix {inherit lib;};
|
||||
servicePort = portUtils.getPort serviceName "AZ-CLD-1";
|
||||
ragApiPort = portUtils.getPort "rag-api" "AZ-CLD-1";
|
||||
envFile = config.age.secrets.librechat-env.path;
|
||||
in {
|
||||
virtualisation.oci-containers = {
|
||||
@@ -29,7 +34,7 @@ in {
|
||||
environmentFiles = [envFile];
|
||||
dependsOn = ["meilisearch"];
|
||||
extraOptions = ["--add-host=postgres:10.89.0.1" "--ip=10.89.0.21" "--network=web"];
|
||||
ports = ["127.0.0.1:8000:8000"]; # optional: expose to host for debugging
|
||||
ports = ["127.0.0.1:${toString ragApiPort}:8000"];
|
||||
};
|
||||
|
||||
containers.mongodb = {
|
||||
@@ -44,10 +49,10 @@ in {
|
||||
extraOptions = ["--ip=10.89.0.22" "--network=web"];
|
||||
};
|
||||
|
||||
containers.librechat = {
|
||||
containers.${serviceName} = {
|
||||
image = "ghcr.io/danny-avila/librechat-dev-api:latest";
|
||||
autoStart = true;
|
||||
ports = ["127.0.0.1:3040:3080"];
|
||||
ports = ["127.0.0.1:${toString servicePort}:3080"];
|
||||
dependsOn = ["mongodb" "rag_api" "meilisearch"];
|
||||
environment = {
|
||||
HOST = "0.0.0.0";
|
||||
@@ -93,12 +98,20 @@ in {
|
||||
timerConfig.RandomizedDelaySec = "15m";
|
||||
};
|
||||
|
||||
# Traefik configuration
|
||||
services.traefik.dynamicConfigOptions.http = {
|
||||
services.librechat.loadBalancer.servers = [{url = "http://localhost:3040/";}];
|
||||
routers.librechat = {
|
||||
services.${serviceName}.loadBalancer.servers = [
|
||||
{
|
||||
url = "http://localhost:${toString servicePort}/";
|
||||
}
|
||||
];
|
||||
|
||||
routers.${serviceName} = {
|
||||
rule = "Host(`chat.az-gruppe.com`)";
|
||||
tls.certResolver = "ionos";
|
||||
service = "librechat";
|
||||
tls = {
|
||||
certResolver = "ionos";
|
||||
};
|
||||
service = serviceName;
|
||||
entrypoints = "websecure";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
virtualisation.oci-containers.containers.litellm = {
|
||||
}: let
|
||||
serviceName = "litellm";
|
||||
portUtils = import ../../../../lib/port-utils.nix {inherit lib;};
|
||||
servicePort = portUtils.getPort serviceName "AZ-CLD-1";
|
||||
in {
|
||||
virtualisation.oci-containers.containers.${serviceName} = {
|
||||
image = "ghcr.io/berriai/litellm:main-stable";
|
||||
ports = ["127.0.0.1:4000:4000"];
|
||||
ports = ["127.0.0.1:${toString servicePort}:4000"];
|
||||
environmentFiles = [config.age.secrets.litellm-env.path];
|
||||
environment = {
|
||||
ANONYMIZED_TELEMETRY = "False";
|
||||
@@ -18,11 +22,18 @@
|
||||
|
||||
# Traefik configuration
|
||||
services.traefik.dynamicConfigOptions.http = {
|
||||
services.litellm.loadBalancer.servers = [{url = "http://127.0.0.1:4000/";}];
|
||||
routers.litellm = {
|
||||
services.${serviceName}.loadBalancer.servers = [
|
||||
{
|
||||
url = "http://localhost:${toString servicePort}/";
|
||||
}
|
||||
];
|
||||
|
||||
routers.${serviceName} = {
|
||||
rule = "Host(`llm.az-gruppe.com`)";
|
||||
tls.certResolver = "ionos";
|
||||
service = "litellm";
|
||||
tls = {
|
||||
certResolver = "ionos";
|
||||
};
|
||||
service = serviceName;
|
||||
entrypoints = "websecure";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,27 +1,32 @@
|
||||
{
|
||||
virtualisation.oci-containers.containers.portainer = {
|
||||
{lib, ...}: let
|
||||
serviceName = "portainer";
|
||||
portUtils = import ../../../../lib/port-utils.nix {inherit lib;};
|
||||
servicePort = portUtils.getPort serviceName "AZ-CLD-1";
|
||||
in {
|
||||
virtualisation.oci-containers.containers.${serviceName} = {
|
||||
image = "docker.io/portainer/portainer-ce:latest";
|
||||
ports = ["127.0.0.1:9000:9000"];
|
||||
ports = ["127.0.0.1:${toString servicePort}:9000"];
|
||||
volumes = [
|
||||
"/etc/localtime:/etc/localtime:ro"
|
||||
"/run/podman/podman.sock:/var/run/docker.sock:ro"
|
||||
"portainer_data:/data"
|
||||
];
|
||||
};
|
||||
# Traefik configuration specific to baserow
|
||||
|
||||
# Traefik configuration
|
||||
services.traefik.dynamicConfigOptions.http = {
|
||||
services.portainer.loadBalancer.servers = [
|
||||
services.${serviceName}.loadBalancer.servers = [
|
||||
{
|
||||
url = "http://localhost:9000/";
|
||||
url = "http://localhost:${toString servicePort}/";
|
||||
}
|
||||
];
|
||||
|
||||
routers.portainer = {
|
||||
routers.${serviceName} = {
|
||||
rule = "Host(`pt.az-gruppe.com`)";
|
||||
tls = {
|
||||
certResolver = "ionos";
|
||||
};
|
||||
service = "portainer";
|
||||
service = serviceName;
|
||||
entrypoints = "websecure";
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user