job "resol-gateway" {
  datacenters = ["alo"]

  group "gw" {
    volume "services" {
      type = "host"
      read_only = true
      source = "services"
    }
    volume "nix-store" {
      type = "host"
      read_only = true
      source = "nix-store"
    }
    volume "sw" {
      type = "host"
      read_only = true
      source = "sw"
    }

    network {
      port "http" {
        static = "3333"
      }
    }

    task "server" {
      driver = "exec"

      config {
        command = "/sw/bin/node"
        args = ["/data/services/resol-vbus/examples/json-live-data-server/index.js"]
      }

      volume_mount {
        volume = "services"
        destination = "/data/services"
      }
      volume_mount {
        volume = "nix-store"
        destination = "/nix/store"
      }
      volume_mount {
        volume = "sw"
        destination = "/sw"
      }

      service {
        name = "resol-gateway"
        port = "http"
      }
    }
  }
}
