Files
LifeFaq/Depriced/nomad-blue.hcl

62 lines
1.1 KiB
HCL
Raw Normal View History

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