lure-web-old/template.nomad

79 lines
1.6 KiB
Plaintext
Raw Normal View History

2023-05-04 22:10:09 +00:00
job "lure-web" {
region = "global"
datacenters = ["dc1"]
type = "service"
group "lure-web" {
network {
port "api" {
to = 8080
}
port "http" {
to = 3000
}
}
task "backend" {
2023-05-04 22:10:09 +00:00
driver = "docker"
env {
LURE_API_GITHUB_SECRET = "${LURE_API_GITHUB_SECRET}"
// Hack to force Nomad to re-deploy the service
// instead of ignoring it
COMMIT_SHA = "${DRONE_COMMIT_SHA}"
}
config {
image = "gitea.elara.ws/lure/backend:latest"
2023-05-04 22:10:09 +00:00
ports = ["api"]
}
service {
2023-09-22 23:22:50 +00:00
name = "lure-backend"
2023-05-04 22:10:09 +00:00
port = "api"
tags = [
"traefik.enable=true",
"traefik.http.routers.lure-backend.rule=Host(`api.lure.elara.ws`)",
"traefik.http.routers.lure-backend.tls.certresolver=letsencrypt"
2023-05-04 22:10:09 +00:00
]
check {
type = "tcp"
port = "api"
interval = "30s"
timeout = "2s"
}
}
}
task "frontend" {
2023-05-04 22:10:09 +00:00
driver = "docker"
config {
image = "gitea.elara.ws/lure/frontend:latest"
2023-05-04 22:10:09 +00:00
ports = ["http"]
2023-08-16 19:52:02 +00:00
args = ["build"]
2023-05-04 22:10:09 +00:00
}
service {
name = "lure-web"
port = "http"
tags = [
"traefik.enable=true",
"traefik.http.routers.lure-frontend.rule=Host(`lure.elara.ws`)",
"traefik.http.routers.lure-frontend.tls.certresolver=letsencrypt",
2023-05-04 22:10:09 +00:00
]
}
}
}
2023-08-10 04:11:09 +00:00
constraint {
attribute = "${attr.cpu.arch}"
operator = "set_contains_any"
2023-09-22 23:22:50 +00:00
value = "amd64,arm64,riscv64"
2023-08-10 04:11:09 +00:00
}
2023-05-04 22:10:09 +00:00
}