Add modules/server/containers/apps/drawio.nix
This commit is contained in:
55
modules/server/containers/apps/drawio.nix
Normal file
55
modules/server/containers/apps/drawio.nix
Normal file
@@ -0,0 +1,55 @@
|
||||
{ config, containerCfg, pkgs, lib, builder, name, ... }:
|
||||
let
|
||||
version = "latest";
|
||||
serverCfg = config.syscfg.server;
|
||||
in
|
||||
{
|
||||
runtime = {
|
||||
paths = [
|
||||
{
|
||||
path = "${serverCfg.path.data.path}/drawio/";
|
||||
owner = "root:root";
|
||||
mode = "0777";
|
||||
}
|
||||
];
|
||||
|
||||
containers = {
|
||||
server = builder.mkContainer {
|
||||
subdomain = containerCfg.subdomain;
|
||||
image = "jgraph/drawio:${version}";
|
||||
port = 8080;
|
||||
extraEnv = {
|
||||
VIRTUAL_HOST = "${containerCfg.subdomain}.${serverCfg.domain}";
|
||||
VIRTUAL_PORT = "8080";
|
||||
LETS_ENCRYPT_ENABLED = "false";
|
||||
DRAWIO_SERVER_URL = "https://${containerCfg.subdomain}.${serverCfg.domain}";
|
||||
DRAWIO_SELF_CONTAINED = "1";
|
||||
EXPORT_URL = "http://drawio-exporter:8000/";
|
||||
DRAWIO_CONFIG = ''
|
||||
{
|
||||
"defaultFonts": [
|
||||
"Helvetica", "Arial", "Verdana",
|
||||
"IBM Plex Mono",
|
||||
"IBM Plex Sans",
|
||||
"Noto Sans",
|
||||
"Latin Modern Math"
|
||||
]
|
||||
}
|
||||
'';
|
||||
};
|
||||
overrides = {
|
||||
ports = ["8080:8080"];
|
||||
};
|
||||
};
|
||||
exporter = builder.mkContainer {
|
||||
image = "jgraph/export-server:${version}";
|
||||
extraEnv = {
|
||||
DRAWIO_SERVER_URL = "https://${containerCfg.subdomain}.${serverCfg.domain}";
|
||||
};
|
||||
overrides = {
|
||||
volumes = ["/run/current-system/sw/share/X11/fonts:/usr/share/fonts/drawio:ro" "/nix/store:/nix/store:ro"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user