Last active
June 22, 2021 18:38
-
-
Save thuongnn/0bf1186c04e9d34ccf4f0bb815dabcfe to your computer and use it in GitHub Desktop.
demo init config
This file contains 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 "http-echo" { | |
datacenters = ["dc1"] | |
group "echo" { | |
count = 1 | |
task "server" { | |
driver = "docker" | |
config { | |
image = "hashicorp/http-echo:latest" | |
ports = [ | |
"http"] | |
args = [ | |
"-listen", | |
":8080", | |
"-text", | |
"Hello World!", | |
] | |
} | |
} | |
network { | |
mode = "bridge" | |
port "http" { | |
static = 8080 | |
to = 8080 | |
} | |
} | |
service { | |
name = "http-echo" | |
port = "http" | |
check { | |
type = "http" | |
path = "/health" | |
interval = "2s" | |
timeout = "2s" | |
} | |
} | |
} | |
} |
This file contains 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 "http-echo" { | |
datacenters = [ | |
"dc1"] | |
group "echo" { | |
count = 1 | |
task "server" { | |
driver = "docker" | |
config { | |
image = "hashicorp/http-echo:latest" | |
ports = [ | |
"http"] | |
args = [ | |
"-listen", | |
":8080", | |
"-text", | |
"Hello World!", | |
] | |
} | |
artifact { | |
source = "http://127.0.0.1:8500/v1/kv/app/portal/nginx.conf?raw=true" | |
// headers { | |
// X-Consul-Token = "de62211f-db02-a0f5-9be1-a967cd46793b" | |
// } | |
} | |
template { | |
source = "local/nginx.conf" | |
destination = "local/test.conf" | |
} | |
} | |
network { | |
mode = "bridge" | |
port "http" { | |
static = 8080 | |
to = 8080 | |
} | |
} | |
service { | |
name = "http-echo" | |
port = "http" | |
check { | |
type = "http" | |
path = "/health" | |
interval = "2s" | |
timeout = "2s" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment