Created
January 6, 2020 21:09
-
-
Save tgross/0baf098b1599475876b3ca371a4042cd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job "countdash" { | |
datacenters = ["dc1"] | |
group "api" { | |
network { | |
mode = "bridge" | |
} | |
service { | |
name = "count-api" | |
port = "9001" | |
connect { | |
sidecar_service {} | |
} | |
} | |
task "web" { | |
driver = "java" | |
config { | |
jar_path = "local/services-kotlin-0.0.1-all.jar" | |
jvm_options = ["-Xmx1024m"] | |
} | |
artifact { | |
source = "http://localhost:8888/services-kotlin-0.0.1-all.jar" | |
options { | |
checksum = "md5:7f14dd3c7df10d5c798d41b53cf635fd" | |
} | |
} | |
env { | |
PORT = "9001" | |
} | |
resources { | |
cpu = 1024 | |
memory = 1024 | |
} | |
} | |
} | |
group "dashboard" { | |
network { | |
mode = "bridge" | |
port "http" { | |
static = 9002 | |
to = 9002 | |
} | |
} | |
service { | |
name = "count-dashboard" | |
port = "9002" | |
connect { | |
sidecar_service { | |
proxy { | |
upstreams { | |
destination_name = "count-api" | |
local_bind_port = 8080 | |
} | |
} | |
} | |
} | |
} | |
task "dashboard" { | |
driver = "docker" | |
env { | |
COUNTING_SERVICE_URL = "http://${NOMAD_UPSTREAM_ADDR_count_api}" | |
} | |
config { | |
image = "hashicorpnomad/counter-dashboard:v1" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment