[dm-companion] Routes the API through the same host as the frontend
This commit is contained in:
35
system/hosts/mcp/containers/dm-companion.nix
Normal file
35
system/hosts/mcp/containers/dm-companion.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
inherit (import ./lib.nix config) mkContainer localHostRule havenisms;
|
||||
in
|
||||
{
|
||||
virtualisation.oci-containers.containers = {
|
||||
dm-companion-pocketbase =
|
||||
let
|
||||
hostName = "dm-pocketbase";
|
||||
in
|
||||
mkContainer {
|
||||
inherit hostName;
|
||||
image = "docker.havenisms.com/lazy-dm/pocketbase";
|
||||
port = 8080;
|
||||
volumes = [
|
||||
"dm-companion:/pb/pb_data"
|
||||
];
|
||||
environment = { };
|
||||
extraLabels = {
|
||||
"traefik.http.routers.${hostName}-api.rule" =
|
||||
"PathPrefix(`/api`) && ${localHostRule "dm" havenisms}";
|
||||
"traefik.http.routers.${hostName}-api.service" = "${hostName}";
|
||||
};
|
||||
};
|
||||
dm-companion = mkContainer {
|
||||
hostName = "dm";
|
||||
image = "docker.havenisms.com/lazy-dm/app";
|
||||
port = 80;
|
||||
dependsOn = [
|
||||
"dm-companion-pocketbase"
|
||||
];
|
||||
volumes = [ ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user