job "example2" { # Run the job in the global region, which is the default. # region = "global" # Specify the datacenters within the region this job can run in. datacenters = ["dc1"] update { stagger = "10s" max_parallel = 1 } # Create a 'cache' group. Each task in the group will be # scheduled onto the same machine. group "web" { # Control the number of instances of this groups. # Defaults to 1 # count = 1 # Configure the restart policy for the task group. If not provided, a # default is used based on the job type. restart { attempts = 10 interval = "5m" delay = "25s" # Mode controls what happens when a task has restarted "attempts" # times within the interval. "delay" mode delays the next restart # till the next interval. "fail" mode does not restart the task if # "attempts" has been hit within the interval. mode = "delay" } task "iis" { driver = "docker" config { image = "microsoft/iis:windowsservercore" command = "cmd" network_mode = "nat" port_map { http = 80 } } resources { cpu = 500 memory = 256 network { mbits = 100 port "http" { static = 8080 } } } service { name = "${TASKGROUP}-iis" port = "http" check { name = "alive" type = "http" path = "/" interval = "10s" timeout = "2s" } } } } }