Files
LifeFaq/.gitea/workflows/nomad-job.hcl
Henrik Jess Nielsen 1cd4e7d4ee
All checks were successful
Build, Push, and Deploy to Nomad / docker-nomad (push) Successful in 44s
[main] Lidt mere context
2025-01-04 02:06:14 +01:00

64 lines
1.1 KiB
HCL

job "lifefaq" {
region = "global"
datacenters = ["dc1"]
type = "service"
update {
stagger = "60s"
max_parallel = 1
canary = 1
auto_revert = true
auto_promote = true
progress_deadline = "6m"
}
group "lifefaq-group" {
count = 1
network {
port "port-app" {
to = 9210 # Internal application port
}
}
# Register the service with Consul
service {
provider = "consul"
name = "lifefaq"
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 "lifefaq-task" {
driver = "docker"
config {
image = "registry.i80.dk/gitea/lifefaq:latest"
ports = ["port-app"]
}
env {
APP_ENV = "production"
PORT = "${NOMAD_PORT_port-app}"
}
resources {
cpu = 250
memory = 80
}
}
}
}