added web.nix to jeevesjr
This commit is contained in:
parent
80bbbc8e9e
commit
cabba86d1a
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@ -19,6 +19,7 @@
|
||||
"builtins",
|
||||
"cachix",
|
||||
"charliermarsh",
|
||||
"cloudflared",
|
||||
"codezombiech",
|
||||
"Compat",
|
||||
"concatLists",
|
||||
|
@ -1,6 +1,9 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [ ../../users/richie/global/zerotier.nix ];
|
||||
imports = [
|
||||
../../users/richie/global/zerotier.nix
|
||||
./docker
|
||||
];
|
||||
|
||||
networking = {
|
||||
hostId = "1beb3026";
|
||||
|
15
systems/jeeves-jr/docker/default.nix
Normal file
15
systems/jeeves-jr/docker/default.nix
Normal file
@ -0,0 +1,15 @@
|
||||
{ pkgs, config, ... }:
|
||||
{
|
||||
imports = [ ./web.nix ];
|
||||
|
||||
virtualisation.oci-containers.backend = "docker";
|
||||
|
||||
system.activationScripts.mkVPN =
|
||||
let
|
||||
docker = config.virtualisation.oci-containers.backend;
|
||||
dockerBin = "${pkgs.${docker}}/bin/${docker}";
|
||||
in
|
||||
''
|
||||
${dockerBin} network inspect web >/dev/null 2>&1 || ${dockerBin} network create web --subnet 172.100.5.0/16
|
||||
'';
|
||||
}
|
39
systems/jeeves-jr/docker/web.nix
Normal file
39
systems/jeeves-jr/docker/web.nix
Normal file
@ -0,0 +1,39 @@
|
||||
{
|
||||
virtualisation.oci-containers.containers = {
|
||||
arch_mirror = {
|
||||
image = "ubuntu/apache2:latest";
|
||||
volumes = [
|
||||
"/ZFS/Media/Docker/Docker/templates/file_server/sites/:/etc/apache2/sites-enabled/"
|
||||
"/ZFS/Media/Mirror/:/data"
|
||||
];
|
||||
ports = [ "800:80" ];
|
||||
extraOptions = [ "--network=web" ];
|
||||
autoStart = true;
|
||||
};
|
||||
haproxy = {
|
||||
image = "haproxy:latest";
|
||||
user = "998:998";
|
||||
environment = {
|
||||
TZ = "Etc/EST";
|
||||
};
|
||||
volumes = [
|
||||
"/ZFS/Main/Docker/jeeves-jr/haproxy/web/haproxy/cloudflare.pem:/etc/ssl/certs/cloudflare.pem"
|
||||
"/ZFS/Main/Docker/jeeves-jr/haproxy/web/haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg"
|
||||
];
|
||||
dependsOn = [ "arch_mirror" ];
|
||||
extraOptions = [ "--network=web" ];
|
||||
autoStart = true;
|
||||
};
|
||||
cloud_flare_tunnel = {
|
||||
image = "cloudflare/cloudflared:latest";
|
||||
cmd = [
|
||||
"tunnel"
|
||||
"run"
|
||||
];
|
||||
environmentFiles = [ "/ZFS/Main/Docker/jeeves-jr/haproxy/web/cloudflare_tunnel.env" ];
|
||||
dependsOn = [ "haproxy" ];
|
||||
extraOptions = [ "--network=web" ];
|
||||
autoStart = true;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user