Files
code-snippets/infra/nomad/code-snippets.nomad.hcl
Liam Pietralla 1a3b0eb43e
All checks were successful
Build, Test & Publish / Build (push) Successful in 30s
Build, Test & Publish / Build and Publish Container Image (push) Successful in 41s
Build, Test & Publish / Deploy to Infrastructure (push) Successful in 35s
version changes
2026-02-04 13:12:11 +11:00

58 lines
1.1 KiB
HCL

variable "deployment_version" {
type = string
description = "The deployment version from CI/CD"
default = "unknown"
}
job "code-snippets" {
datacenters = ["dc1"]
type = "service"
meta {
version = var.deployment_version
}
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:latest"
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"
}
}
}
}
}