Raw_Exec Nomad Job Syntax

I’m trying to kick off a Nomad job using raw_exec. I modeled this job based on one of the Springboot Java_Driver job. I don’t get any errors however the job and tasks fail.

This is app is written in Go Lang and it is compiled as executable file (main) and it takes argument to use a port. I’m using the label http and NOMAD_PORT so that the ports can be dynamically assigned by Nomad so that this can be picked up by Consul and advertised into Fabio.

Also if I were to launch this app outside Nomad as standalone, by default this runs in foreground and had to kill by using Ctrl+c. Not sure if this is one of the problem.

job "some-job" {
  datacenters = ["some-dc"]
  type = "service"

  group "dev-poc" {
    count = 2
    task "dit-ui" {
      driver = "raw_exec"
      config {
        command = "/opt/app-dir-nomad/backend/main"
		args    = ["-port=${NOMAD_PORT_http}"]
      }
      resources {
        cpu    = 500
        memory = 300
                network {
                  port "http" {}
                }
      }
      service {
        port = "http"
        name = "dit-ui"
        tags = [
          "urlprefix-/idt-ui/ strip=/idt-ui",
          ]
        check {
          type     = "http"
          path     = "/"
          interval = "2s"
          timeout  = "2s"
        }
      }
    }
  }
}

How can I fix this? Thanks in advance for help!