site/template.nomad
Elara fe1e993cee
Some checks failed
ci/woodpecker/manual/woodpecker Pipeline failed
Fix Nomad conflict
2024-03-09 05:35:27 +00:00

54 lines
1.4 KiB
HCL

job "queerdevs-site" {
region = "global"
datacenters = ["dc1"]
type = "service"
group "queerdevs-site" {
count = 2
network {
port "http" {
to = 8000
}
}
task "webserver" {
driver = "docker"
env {
// Hack to force Nomad to re-deploy the service
// instead of ignoring it
COMMIT_SHA = "${DRONE_COMMIT_SHA}"
}
config {
image = "gitea.elara.ws/elara6331/webserver:latest"
ports = ["http"]
volumes = ["local/site/public:/html:ro"]
}
artifact {
source = "https://api.minio.elara.ws/queerdevs/site.tar.gz"
destination = "local/site"
}
service {
name = "queerdevs-site"
port = "http"
tags = [
"traefik.enable=true",
"traefik.http.middlewares.queerdevs-site.redirectRegex.regex=^https://www\\.queerdevs\\.org",
"traefik.http.middlewares.queerdevs-site.redirectRegex.replacement=https://queerdevs.org",
"traefik.http.middlewares.queerdevs-site.redirectRegex.permanent=true",
"traefik.http.routers.queerdevs-site.rule=Host(`queerdevs.org`) || Host(`www.queerdevs.org`)",
"traefik.http.routers.queerdevs-site.middlewares=queerdevs-site-redir",
"traefik.http.routers.queerdevs-site.tls.certResolver=letsencrypt",
]
}
}
}
}