2024-01-18 11:34:01 +01:00
|
|
|
job "[[ .instance ]]" {
|
2023-12-02 23:40:28 +01:00
|
|
|
|
2024-04-29 09:36:35 +02:00
|
|
|
[[ template "common/job_start.tpl" . ]]
|
2023-12-02 23:40:28 +01:00
|
|
|
|
|
|
|
group "diagrams" {
|
2024-04-29 09:36:35 +02:00
|
|
|
[[- $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
|
2024-05-11 21:09:18 +02:00
|
|
|
[[ template "common/check_settings" $c ]]
|
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 {
|
2024-04-29 09:36:35 +02:00
|
|
|
[[ 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 {
|
2024-04-29 09:36:35 +02:00
|
|
|
TMPDIR = "/local/tmp"
|
2023-12-02 23:40:28 +01:00
|
|
|
TOMCAT_ADDRESS = "127.0.0.1"
|
|
|
|
}
|
|
|
|
|
2024-04-29 09:36:35 +02:00
|
|
|
[[ 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"
|
|
|
|
}
|
|
|
|
|
2024-04-29 09:36:35 +02:00
|
|
|
[[ template "common/resources" $c ]]
|
2023-12-02 23:40:28 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|