diff --git a/jobs/services/plausible.hcl b/jobs/services/plausible.hcl new file mode 100644 index 0000000..2a6f88b --- /dev/null +++ b/jobs/services/plausible.hcl @@ -0,0 +1,125 @@ +job "plausible" { + datacenters = ["aperture"] + type = "service" + + group "web" { + network { + port "http" { + to = 8000 + } + port "db" { + static = 8123 + } + } + + task "plausible" { + service { + name = "plausible" + port = "http" + + check { + type = "http" + path = "/" + interval = "10s" + timeout = "2s" + } + + tags = [ + "traefik.enable=true", + "traefik.http.routers.plausible.rule=Host(`plausible.redbrick.dcu.ie`)", + "traefik.http.routers.plausible.entrypoints=websecure", + "traefik.http.routers.plausible.tls.certresolver=lets-encrypt" + ] + } + + driver = "docker" + + config { + image = "plausible/analytics:latest" + ports = ["http"] + + command = "/bin/sh" + args = ["-c", "sleep 10 && /entrypoint.sh db migrate && /entrypoint.sh run"] + } + + template { + data = < + + warning + true + + + + + + + + + + + + +EOH + destination = "local/clickhouse.xml" + } + + template { + data = < + + + 0 + 0 + + + +EOH + destination = "local/clickhouse-user-config.xml" + } + + resources { + memory = 800 + } + } + } +}