Files
ti/citti.nomad

102 lines
1.8 KiB
Plaintext
Raw Normal View History

job "citti" {
region = "global"
datacenters = ["dc1"]
type = "service"
update {
stagger = "30s"
max_parallel = 1
canary = 1
min_healthy_time = "10s"
healthy_deadline = "5m"
auto_revert = true
auto_promote = true
progress_deadline = "10m"
}
group "app" {
count = 1
constraint {
attribute = "${node.unique.name}"
value = "int"
}
network {
port "http" {}
}
reschedule {
attempts = 5
interval = "10m"
delay = "30s"
delay_function = "exponential"
max_delay = "120s"
unlimited = false
}
ephemeral_disk {
size = 500
sticky = true
migrate = true
}
service {
provider = "consul"
name = "citti"
port = "http"
tags = [
"traefik.enable=true",
"traefik.http.routers.citti.rule=Host(`citti.i80.dk`)",
"traefik.http.routers.citti.tls=true",
]
canary_tags = [
"traefik.enable=false",
]
check {
name = "http_health_check"
type = "http"
path = "/health"
interval = "10s"
timeout = "5s"
check_restart {
limit = 3
grace = "10s"
}
}
}
task "web" {
driver = "docker"
config {
image = "registry.i80.dk/gitea/citti:latest"
ports = ["http"]
force_pull = true
}
restart {
attempts = 10
interval = "10m"
delay = "10s"
mode = "fail"
}
env {
DATA_DIR = "${NOMAD_ALLOC_DIR}/data"
PORT = "${NOMAD_PORT_http}"
HOST = "0.0.0.0"
}
resources {
cpu = 200
memory = 256
}
}
}
}