-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathchatjob.nomad.hcl
63 lines (61 loc) · 1.31 KB
/
chatjob.nomad.hcl
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
variable "consul_namespace"{
description = "which consul namespace you want to deploy this job to"
default = "default"
}
job "chat2" {
datacenters = ["eu-west-2a","eu-west-2b","eu-west-2c","eu-west-2","dc1"]
type = "service"
group "anon_chat" {
count = 1
consul{
namespace = var.consul_namespace
}
network {
mode = "bridge"
port "http" {
static = 9002
to = 5000
}
}
task "anon_chat_server" {
driver = "raw_exec"
template {
data = <<EOH
#!/bin/bash
cd local/repo/1/
npm install && npm start
EOH
destination = "local/run.sh"
perms = "755"
}
artifact {
source = "git::https://github.com/GuyBarros/anonymouse-realtime-chat-app"
destination = "local/repo/1/"
}
env{
MONGODB_SERVER = "127.0.0.1"
MONGODB_PORT = 27017
}
config {
command = "bash"
args = ["local/run.sh"]
}
}
service {
provider = "consul"
name = "chat"
tags = ["chat"]
port = "http"
connect {
sidecar_service {
proxy {
upstreams {
destination_name = "mongodb"
local_bind_port = 27017
}
}
}
}
}
}
}