terraform-nomad/jobs/testapp1.hcl
Ben Vincent f1f147024c
Some checks failed
Build / build (pull_request) Failing after 30s
feat: initial setup
- manage nomad jobs
- create makefile
- create gitignore
- manage terragrunt environments
- add build jobs
2024-12-28 22:13:49 +11:00

63 lines
1.1 KiB
HCL

job "testapp1" {
datacenters = ["au-syd1"]
type = "service"
group "http" {
count = 3
network {
port "http" {
to = 8080
}
}
update {
max_parallel = 2
health_check = "checks"
min_healthy_time = "30s"
healthy_deadline = "5m"
progress_deadline = "10m"
auto_revert = true
auto_promote = true
canary = 1
stagger = "15s"
}
task "http-server" {
driver = "docker"
config {
image = "git.query.consul/unkin/almalinux9:latest"
network_mode = "bridge"
ports = ["http"]
command = "sh"
args = ["-c", "cd /data/; python3 -m http.server 8080"]
volumes = ["/shared/nomad/testing:/data"]
}
resources {
cpu = 250
memory = 128
}
service {
name = "testapp1"
port = "http"
address_mode = "driver"
check {
type = "http"
path = "/"
interval = "10s"
timeout = "2s"
}
}
env {
PYTHONUNBUFFERED = "1"
}
}
}
}