nixcfg/cluster/staging/app/dummy/deploy/dummy-nginx.hcl
2022-11-16 00:12:14 +01:00

69 lines
1.3 KiB
HCL

job "dummy-nginx" {
datacenters = ["neptune"]
type = "service"
group "nginx" {
count = 1
volume "nix-store" {
type = "host"
source = "nix-store"
read_only = true
}
volume "nix-current-system-bin" {
type = "host"
source = "nix-current-system-bin"
read_only = true
}
network {
port "http" {
to = 8080
}
}
task "not-actually-nginx" {
driver = "exec"
config {
command = "env"
args = [
"/run/current-system/sw/bin/nix-shell",
"--run", "python3 -m http.server 8080"
]
}
env = {
NIX_PATH = "nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos"
}
volume_mount {
volume = "nix-store"
read_only = true
destination = "/nix"
}
volume_mount {
volume = "nix-current-system-bin"
read_only = true
destination = "/run/current-system/sw/bin"
}
template {
data = file("shell.nix")
destination = "shell.nix"
}
}
service {
port = "http"
tags = [
"tricot home.adnab.me 100",
]
check {
type = "http"
path = "/"
interval = "10s"
timeout = "2s"
}
}
}
}