Files
code-snippets/infra/nomad/code-snippets.nomad.hcl
Liam Pietralla 0d15ac8d01
All checks were successful
Build, Test & Publish / Build (push) Successful in 29s
Build, Test & Publish / Build and Publish Container Image (push) Successful in 39s
Build, Test & Publish / Deploy to Infrastructure (push) Successful in 30s
ensure job is on client
2025-11-12 14:11:19 +11:00

53 lines
1.0 KiB
HCL

variable "version" {
type = string
default = "latest"
}
job "code-snippets" {
datacenters = ["dc1"]
type = "service"
constraint {
operator = "="
attribute = "${meta.machine_role}"
value = "client"
}
group "code-snippets" {
count = 1
network {
port "http" {
to = 80
}
}
task "code-snippets" {
driver = "docker"
config {
image = "liamsgit.dev/liampietralla/code-snippets:${var.version}"
force_pull = true
ports = ["http"]
}
service {
name = "code-snippets"
port = "http"
tags = [
"traefik.enable=true",
"traefik.http.routers.codesnippets.rule=Host(`code.liampietralla.com`)",
"traefik.http.routers.codesnippets.entrypoints=websecure",
"traefik.http.routers.codesnippets.tls.certresolver=letsencrypt"
]
check {
type = "http"
path = "/"
interval = "10s"
timeout = "2s"
}
}
}
}
}