forked from GuyBarros/nomad_jobs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchatapp-darkmode.nomad
63 lines (62 loc) · 1.48 KB
/
chatapp-darkmode.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
63
job "chat-app" {
datacenters = ["eu-west-2a","eu-west-2b","eu-west-2c","eu-west-2","dc1"]
type = "service"
group "chat-app" {
count = 3
update {
max_parallel = 1
health_check = "checks"
min_healthy_time = "15s"
healthy_deadline = "2m"
# canary = 3
}
network {
mode = "bridge"
port "http" {
to = 5000
}
}
task "chat-app" {
driver = "docker"
config {
image = "lhaig/anon-app:dark-0.03"
}
env {
MONGODB_SERVER = "127.0.0.1"
MONGODB_PORT = "27017"
}
resources {
cpu = 300 # MHz
memory = 512 # MB
}
} # end chat-app task
service {
name = "chat-app"
tags = ["urlprefix-/chat",
"traefik.enable=true",
"traefik.http.routers.chat.rule=PathPrefix(`/chat`)||PathPrefix(`/socket.io`)",
"traefik.http.services.chat.loadbalancer.sticky",
"traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto = https"
]
port = "http"
check {
name = "chat-app alive"
type = "http"
path = "/chats"
interval = "10s"
timeout = "2s"
}
connect {
sidecar_service {
tags = ["chat-proxy"]
proxy {
upstreams {
destination_name = "mongodb"
local_bind_port = 27017
}
}
}
} # end connnect
} # end service
} # end chat-app group
}