Files
PythonTemplateProject/.gitea/workflows/nomad-job.hcl.tmpl
Henrik Jess Nielsen 2d90c81204
Some checks failed
Build, Push, and Deploy to Nomad / docker-nomad (push) Failing after 4m20s
[main] Template update
2024-12-09 21:07:31 +01:00

61 lines
1.1 KiB
Cheetah

job "[[PROJECT_NAME]]" {
region = "global"
datacenters = ["dc1"]
type = "service"
update {
stagger = "60s"
max_parallel = 1
progress_deadline = "6m"
}
group "[[PROJECT_NAME]]-group" {
count = 1
network {
port "port-app" {
to = [[PORT]] # Internal application port
}
}
# Register the service with Consul
service {
provider = "consul"
name = "[[PROJECT_NAME]]"
port = "port-app"
# Traefik-specific tags for routing
tags = [
"PORT=${NOMAD_PORT_port-app}"
]
# Define a health check using TCP
check {
name = "tcp_check"
type = "tcp"
interval = "10s"
timeout = "2s"
}
}
task "[[PROJECT_NAME]]-task" {
driver = "docker"
config {
image = "registry.i80.dk/gitea/[[PROJECT_NAME]]:latest"
ports = ["port-app"]
}
env {
APP_ENV = "production"
PORT = "${NOMAD_PORT_port-app}"
}
resources {
cpu = 250
memory = 80
}
}
}
}