Skip to content

Instantly share code, notes, and snippets.

@jsiebens
Created March 14, 2020 14:18
Show Gist options
  • Save jsiebens/9bc034b17e92945ff564b341621b9fe4 to your computer and use it in GitHub Desktop.
Save jsiebens/9bc034b17e92945ff564b341621b9fe4 to your computer and use it in GitHub Desktop.
job "web-gateway" {
region = "global"
datacenters = ["dc1"]
type = "service"
group "web-gateway" {
count = 1
task "inlets" {
driver = "raw_exec"
artifact {
source = "https://github.com/inlets/inlets/releases/download/2.7.0/inlets-armhf"
}
config {
command = "local/inlets-armhf"
args = [
"client",
"--remote", "ws://<your-exit-node>:8080",
"--token", "<your-token-here>",
"--upstream", "http://localhost:80"
]
}
}
task "traefik" {
driver = "raw_exec"
artifact {
source = "https://github.com/containous/traefik/releases/download/v2.1.6/traefik_v2.1.6_linux_armv7.tar.gz"
}
config {
command = "local/traefik"
args = [
"--configFile=local/traefik.toml"
]
}
template {
data = <<EOF
[log]
level = "DEBUG"
[entryPoints]
[entryPoints.web]
address = ":80"
[entryPoints.traefik]
address = ":8080"
[api]
insecure = true
dashboard = true
[providers.consulCatalog]
prefix = "traefik"
exposedByDefault = false
EOF
destination = "local/traefik.toml"
}
resources {
cpu = 100
memory = 128
network {
mbits = 10
port "http" {
static = 80
}
port "api" {
static = 8080
}
}
}
service {
name = "web-gateway"
check {
name = "alive"
type = "tcp"
port = "http"
interval = "10s"
timeout = "2s"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment