containers: make all host ports configurable

This commit is contained in:
steveej 2020-09-14 19:38:36 +02:00
parent f2c59bd79b
commit 4c66c73024
4 changed files with 23 additions and 7 deletions

View file

@ -3,7 +3,11 @@
let
passwords = import ../../variables/passwords.crypt.nix;
in args // {
in
{ imapsPort ? 993
, sievePort ? 4190
}: args // {
config = { pkgs, ... }: {
imports = [
../profiles/containers/configuration.nix
@ -143,14 +147,14 @@ in args // {
{
# imaps
containerPort = 993;
hostPort = 993;
hostPort = imapsPort;
protocol = "tcp";
}
{
# sieve
containerPort = 4190;
hostPort = 4190;
hostPort = sievePort;
protocol = "tcp";
}
];

View file

@ -2,7 +2,10 @@
let
in args // {
in
{ syncthingPort ? 22000
}: args // {
config = { config, pkgs, ... }: {
imports = [
../profiles/containers/configuration.nix
@ -34,7 +37,7 @@ in args // {
forwardPorts = [
{
containerPort = 22000;
hostPort = 22000;
hostPort = syncthingPort;
protocol = "tcp";
}
];

View file

@ -2,7 +2,9 @@
let
in args // {
in
{ httpsPort ? 443
}: args // {
config = { config, pkgs, ... }: {
imports = [
../profiles/containers/configuration.nix
@ -89,7 +91,7 @@ in args // {
{
# https
containerPort = 443;
hostPort = 443;
hostPort = httpsPort;
protocol = "tcp";
}
];

View file

@ -101,16 +101,23 @@ in {
mailserver = import ../../containers/mailserver.nix {
hostAddress = "192.168.100.10";
localAddress = "192.168.100.11";
} {
imapsPort = 993;
sievePort = 4190;
};
webserver = import ../../containers/webserver.nix {
hostAddress = "192.168.100.12";
localAddress = "192.168.100.13";
} {
httpsPort = 443;
};
syncthing = import ../../containers/syncthing.nix {
hostAddress = "192.168.100.14";
localAddress = "192.168.100.15";
} {
syncthingPort = 22000;
};
backup = import ../../containers/backup.nix {