diff --git a/from-github.nomad b/from-github.nomad index 1f46a60..65c37bc 100644 --- a/from-github.nomad +++ b/from-github.nomad @@ -10,7 +10,7 @@ job "from-github" { task "api" { driver = "java" artifact { - source = "https://github.com/apuntesdejava/java-nomad-example/releases/download/2/java-nomad-example-runner.jar" + source = "https://github.com/apuntesdejava/java-nomad-example/releases/download/4/java-nomad-example-runner.jar" destination = "local" } config { diff --git a/from-local.nomad b/from-local.nomad index 8e8827f..8a43a71 100644 --- a/from-local.nomad +++ b/from-local.nomad @@ -10,19 +10,26 @@ job "from-local" { group "backend" { count = 1 network { - port "http" { - static = 8080 - } + port "http" {} + port "debug" {} } task "api" { driver = "raw_exec" config { command = "java" args = [ + "-Dquarkus.http.port=${NOMAD_PORT_http}", + "-Dquarkus.http.host=0.0.0.0", + "-Ddebug.port=${NOMAD_PORT_debug}", "-jar", var.jar_path ] } + + env { + MY_IP_ADDRESS = "${NOMAD_IP_http}" + MY_PORT = "${NOMAD_PORT_http}" + } } }