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