Add Caddy Service

This commit is contained in:
2024-02-06 12:58:24 -08:00
parent c5346ef2ed
commit 94b8e0694c
2 changed files with 60 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
job "caddy" {
datacenters = ["dc1"]
type = "service"
group "caddy" {
count = 1
network {
port "http" {
to = 80
}
}
service {
name = "caddy"
provider = "consul"
port = "http"
tags = [
"traefik.enable=true",
"traefik.http.routers.caddy.tls=true",
"traefik.http.routers.caddy.entrypoints=websecure",
"traefik.http.routers.caddy.rule=Host(`example.local`)"
]
check {
type = "http"
path = "/"
interval = "10s"
timeout = "2s"
}
}
task "caddy" {
driver = "docker"
config {
image = "caddy:alpine"
ports = ["http"]
}
}
}
}