forked from GuyBarros/nomad_jobs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mongodb.nomad
91 lines (83 loc) · 1.95 KB
/
mongodb.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
job "mongodb" {
datacenters = ["eu-west-2","ukwest","sa-east-1","ap-northeast-1","dc1"]
type = "service"
group "db" {
count = 1
volume "mongodb_vol" {
type = "host"
source = "mongodb_mount"
}
network {
mode = "bridge"
}
task "mongodb" {
driver = "docker"
volume_mount {
volume = "mongodb_vol"
destination = "/data/db"
}
config {
image = "mongo"
}
logs {
max_files = 5
max_file_size = 15
}
resources {
cpu = 500
memory = 512
}
}
service {
name = "mongodb"
tags = ["mongodb"]
port = "27017"
connect {
sidecar_service {}
}
}
}
group "express" {
count = 1
network {
mode = "bridge"
port "http" {
static = 8082
to = 8082
}
}
task "mongo-express" {
driver = "docker"
env {
"ME_CONFIG_MONGODB_SERVER" = "127.0.0.1"
"ME_CONFIG_MONGODB_PORT" = "27017"
}
config {
image = "mongo-express"
}
logs {
max_files = 5
max_file_size = 15
}
resources {
cpu = 500
memory = 512
}
}
service {
name = "mongo-express"
tags = ["mongo-express"]
port = "http"
connect {
sidecar_service {
proxy {
upstreams {
destination_name = "mongodb"
local_bind_port = 27017
}
}
}
}
}
}
}