server7: Move hydra proxy to a container

This commit is contained in:
Ehmry - 2020-04-21 10:04:38 +02:00
parent a1656f9553
commit 2249553661
3 changed files with 34 additions and 2 deletions

View File

@ -13,6 +13,7 @@ rec {
hydra.publicKey =
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDhurL/sxsXRglKdLfiWIcK+iqpyhGrGt/MoBODsgvig";
hydra7 = { };
mpd-index = { };
nfs = { };
ncdc.publicKey =

View File

@ -1,8 +1,6 @@
{ lib, ... }:
let
yggaddr = import ../yggaddr.nix;
containerFunc = name:
# Generate a container expression from the directory at `name`.
{

View File

@ -0,0 +1,33 @@
name:
let port = 3000;
in (import ../outer-defaults.nix name) // {
bindMounts."/srv/c3d2" = {
hostPath = "/srv/ceph/c3d2";
isReadOnly = false;
};
ephemeral = true;
forwardPorts = [{
containerPort = port;
hostPort = port;
protocol = "tcp";
}];
config = { config, pkgs, lib, ... }: {
imports = [ ../inner-defaults.nix ];
networking.firewall.enable = false;
services.nginx = {
enable = true;
virtualHosts = {
"hydra7.y.c3d2.de" = {
default = true;
locations."/".proxyPass = "http://127.0.0.1:${toString port}";
};
};
};
};
}