dotfiles/terranix/main/containers/website/job.hcl
magic_rb 4a29b6d8d3
Move terranix config into terranix/main
Signed-off-by: magic_rb <magic_rb@redalder.org>
2024-04-07 10:45:07 +02:00

81 lines
1.3 KiB
HCL

variable "flake_ref" {
type = string
}
variable "flake_sha" {
type = string
}
variable "store_path" {
type = object({
website = string
})
}
job "website" {
datacenters = [ "homelab-1" ]
type = "service"
constraint {
attribute = "${attr.unique.hostname}"
value = "blowhole"
}
group "website" {
count = 2
update {
max_parallel = 1
}
network {
mode = "bridge"
}
service {
name = "website"
port = "80"
check {
type = "http"
address_mode = "alloc"
path = "/"
port = "80"
interval = "10s"
timeout = "10s"
}
connect {
sidecar_service {}
sidecar_task {
resources {
cpu = 75
memory = 48
}
config {
memory_hard_limit = 96
}
}
}
}
task "apache" {
driver = "docker"
config {
nix_flake_ref = "${var.flake_ref}#nixngConfigurations.website.config.system.build.toplevel"
nix_flake_sha = var.flake_sha
nix_flake_store_path = var.store_path.website
entrypoint = [ "init" ]
}
resources {
cpu = 128
memory = 32
memory_max = 64
}
}
}
}