39 lines
868 B
Nix
39 lines
868 B
Nix
{ config, containerCfg, pkgs, lib, builder, name,... }:
|
|
let
|
|
serverCfg = config.syscfg.server;
|
|
ethercalc_exe = pkgs.ethercalc;
|
|
|
|
image = pkgs.dockerTools.streamLayeredImage {
|
|
name = "ethercalc";
|
|
tag = ethercalc_exe.version;
|
|
contents = [ pkgs.bashInteractive ];
|
|
config = {
|
|
Entrypoint = [ "${ethercalc_exe}/bin/ethercalc" ];
|
|
ExposedPorts = { "8080/tcp" = {}; };
|
|
};
|
|
};
|
|
in {
|
|
paths = [{
|
|
path="${serverCfg.dataPath}/etherpad/";
|
|
mode = "0666";
|
|
}];
|
|
|
|
containers = {
|
|
server = builder.mkContainer {
|
|
subdomain = containerCfg.subdomain;
|
|
imageStream = image;
|
|
port = 8080;
|
|
ip = containerCfg.ip;
|
|
secret = name;
|
|
extraEnv = {
|
|
ETHERCALC_PORT = "8080";
|
|
};
|
|
overrides = {
|
|
volumes = [
|
|
"${serverCfg.dataPath}/ethercalc:/data"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|