55 lines
1.4 KiB
Nix
Raw Normal View History

2024-07-05 14:30:41 -04:00
{ config, ... }:
2024-07-05 13:39:30 -04:00
let
vars = import ../vars.nix;
in
2024-05-27 20:20:00 -04:00
{
virtualisation.oci-containers.containers = {
arch_mirror = {
image = "ubuntu/apache2:latest";
volumes = [
2024-07-05 13:51:47 -04:00
"${../../../users/richie/global/docker_templates}/file_server/sites/:/etc/apache2/sites-enabled/"
2024-07-05 14:30:41 -04:00
"${vars.main_mirror}:/data"
2024-05-27 20:20:00 -04:00
];
ports = [ "800:80" ];
extraOptions = [ "--network=web" ];
autoStart = true;
};
haproxy = {
image = "haproxy:latest";
2024-07-05 14:50:39 -04:00
user = "600:600";
2024-05-27 20:20:00 -04:00
environment = {
TZ = "Etc/EST";
};
volumes = [
2024-07-05 14:30:41 -04:00
"${config.sops.secrets."docker/haproxy_cert".path}:/etc/ssl/certs/cloudflare.pem"
"${./haproxy.cfg}:/usr/local/etc/haproxy/haproxy.cfg"
2024-05-27 20:20:00 -04:00
];
2024-07-05 14:57:29 -04:00
dependsOn = [
"arch_mirror"
"uptime_kuma"
];
2024-05-27 20:20:00 -04:00
extraOptions = [ "--network=web" ];
autoStart = true;
};
cloud_flare_tunnel = {
image = "cloudflare/cloudflared:latest";
cmd = [
"tunnel"
"run"
];
2024-07-05 14:30:41 -04:00
environmentFiles = [ config.sops.secrets."docker/cloud_flare_tunnel".path ];
2024-05-27 20:20:00 -04:00
dependsOn = [ "haproxy" ];
extraOptions = [ "--network=web" ];
autoStart = true;
};
};
2024-07-05 14:30:41 -04:00
sops = {
defaultSopsFile = ../secrets.yaml;
secrets = {
"docker/cloud_flare_tunnel".owner = "docker-service";
"docker/haproxy_cert".owner = "docker-service";
};
};
2024-05-27 20:20:00 -04:00
}