first commit
This commit is contained in:
65
job.hcl
Normal file
65
job.hcl
Normal file
@@ -0,0 +1,65 @@
|
||||
variables {
|
||||
version = "latest"
|
||||
domain = "homelab.local"
|
||||
count = 1
|
||||
}
|
||||
|
||||
job "nodejs-app" {
|
||||
datacenters = ["*"]
|
||||
type = "service"
|
||||
|
||||
update {
|
||||
max_parallel = 1
|
||||
min_healthy_time = "10s"
|
||||
healthy_deadline = "3m"
|
||||
auto_revert = true
|
||||
}
|
||||
|
||||
group "nodejs-app" {
|
||||
count = var.count
|
||||
|
||||
network {
|
||||
port "http" { to = 3000 }
|
||||
}
|
||||
|
||||
task "nodejs-app" {
|
||||
driver = "docker"
|
||||
|
||||
config {
|
||||
image = "registry.${var.domain}/kurt/nodejs-app:${var.version}"
|
||||
ports = ["http"]
|
||||
}
|
||||
|
||||
env {
|
||||
NODE_ENV = "production"
|
||||
APP_VERSION = var.version
|
||||
PORT = "3000"
|
||||
}
|
||||
|
||||
resources {
|
||||
cpu = 256
|
||||
memory = 256
|
||||
}
|
||||
}
|
||||
|
||||
service {
|
||||
name = "nodejs-app"
|
||||
port = "http"
|
||||
provider = "nomad"
|
||||
|
||||
tags = [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.nodejs-app.rule=Host(`nodejs-app.${var.domain}`)",
|
||||
"traefik.http.routers.nodejs-app.tls=true",
|
||||
"traefik.http.routers.nodejs-app.tls.certresolver=letsencrypt",
|
||||
]
|
||||
|
||||
check {
|
||||
type = "http"
|
||||
path = "/health"
|
||||
interval = "10s"
|
||||
timeout = "2s"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user