diagrams/diagrams.nomad.hcl

74 lines
1.4 KiB
HCL
Raw Normal View History

2024-01-18 11:34:01 +01:00
job "[[ .instance ]]" {
2023-12-02 23:40:28 +01:00
[[ template "common/job_start.tpl" . ]]
2023-12-02 23:40:28 +01:00
group "diagrams" {
[[- $c := merge .diagrams . ]]
[[ template "common/group_start" $c ]]
2023-12-02 23:40:28 +01:00
network {
mode = "bridge"
}
service {
2023-12-21 22:22:12 +01:00
name = "[[ .instance ]][[ .consul.suffix ]]"
2023-12-02 23:40:28 +01:00
port = 8282
[[ template "common/connect.tpl" $c ]]
check {
type = "http"
path = "/health"
expose = true
interval = "[[ $c.consul.check.interval ]]"
timeout = "[[ $c.consul.check.timeout ]]"
2023-12-02 23:40:28 +01:00
check_restart {
limit = 4
grace = "1m"
}
}
tags = [
2024-01-26 23:38:23 +01:00
[[ template "common/traefik_tags" $c ]]
2023-12-02 23:40:28 +01:00
]
}
task "diagrams" {
2024-01-18 11:34:01 +01:00
driver = "[[ $c.nomad.driver ]]"
2023-12-02 23:40:28 +01:00
config {
[[ template "common/image" $c ]]
2023-12-09 22:38:06 +01:00
pids_limit = 200
2023-12-02 23:40:28 +01:00
volumes = [
"local/PreConfig.js:/opt/tomcat/webapps/draw/js/PreConfig.js",
"local/PostConfig.js:/opt/tomcat/webapps/draw/js/PostConfig.js"
]
}
env {
TMPDIR = "/local/tmp"
2023-12-02 23:40:28 +01:00
TOMCAT_ADDRESS = "127.0.0.1"
}
[[ template "common/file_env" $c ]]
2023-12-02 23:40:28 +01:00
template {
data =<<_EOT
[[ template "diagrams/PreConfig.js.tpl" $c ]]
_EOT
destination = "local/PreConfig.js"
}
template {
data =<<_EOT
[[ template "diagrams/PostConfig.js.tpl" $c ]]
_EOT
destination = "local/PostConfig.js"
}
[[ template "common/resources" $c ]]
2023-12-02 23:40:28 +01:00
}
}
}