-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathjobspec.nomad
62 lines (52 loc) · 1.41 KB
/
jobspec.nomad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
variable "domain_prod" {
type = string
description = "The application's production domain."
}
job "__REPO__NAME__" {
region = "az-us"
datacenters = ["us-west-2"]
type = "service"
namespace = "__NAMESPACE__"
constraint {
attribute = attr.kernel.name
value = "linux"
}
constraint {
attribute = node.class
value = "spot"
}
group "__REPO__NAME__" {
count = 1
network {
mode = "bridge"
port "http" { to = 80 }
port "service" { to = 5000 }
}
consul {
namespace = "__NAMESPACE__"
}
service {
name = "__REPO__NAME__-client"
port = "http"
tags = [
"traefik.enable=true",
"traefik.http.routers.__REPO__NAME__.rule=Host(`${var.domain_prod}`)",
"traefik.http.routers.__REPO__NAME__.entrypoints=https",
"traefik.http.routers.__REPO__NAME__.tls=true",
"traefik.http.services.__REPO__NAME__.loadbalancer.sticky=true",
"traefik.http.services.__REPO__NAME__.loadbalancer.sticky.cookie.secure=true",
"traefik.http.services.__REPO__NAME__.loadbalancer.sticky.cookie.httpOnly=true"
]
}
task "__REPO__NAME__-client" {
driver = "docker"
config {
image = "bmgfsre.azurecr.io/__REPO__NAME___client:__BUILD__NUMBER__"
ports = ["http"]
# args = [
# "GENERATE_SOURCEMAP=true"
# ]
}
}
}
}