Merge pull request 'feat: add app-sudaporn-research-normalised' (#6) from neoloc/appsdeploy_sudaporn into master

Reviewed-on: https://git.query.consul/unkin/terraform-nomad/pulls/6
This commit is contained in:
Ben Vincent 2025-03-09 19:12:28 +11:00
commit cbaa137eb6
2 changed files with 72 additions and 0 deletions

View File

@ -6,6 +6,7 @@ inputs = {
job_files = [
"testapp1",
"testapp2",
"app-sudaporn-research-normalised",
]
policy_files = []
}

View File

@ -0,0 +1,71 @@
job "app-sudaporn-research-normalised" {
datacenters = ["au-syd1"]
type = "service"
group "app" {
count = 2
network {
port "http" {
to = 80
}
}
update {
max_parallel = 1
health_check = "checks"
min_healthy_time = "30s"
healthy_deadline = "5m"
progress_deadline = "10m"
auto_revert = true
auto_promote = true
canary = 1
stagger = "20s"
}
# Ensure instances run on different agents
spread {
attribute = "${node.unique.id}"
weight = 100
}
# Application Task
task "webapp" {
driver = "docker"
config {
image = "git.query.consul/unkin/almalinux9-base:latest"
network_mode = "bridge"
ports = ["http"]
command = "sh"
args = [
"-c",
"rm -rf /app && git clone https://git.query.consul/unkin/app-sudaporn-research-normalised.git /app && cd /app && make run"
]
}
env {
PORT = "80"
PYTHONUNBUFFERED = "1"
}
resources {
cpu = 500
memory = 350
}
service {
name = "app-sudaporn-research-normalised"
port = "http"
address_mode = "driver"
check {
type = "http"
path = "/"
interval = "10s"
timeout = "2s"
}
}
}
}
}