Update nova timetable-sync job (#51)

Co-authored-by: wizzdom <dom@wizzdom.xyz>
This commit is contained in:
nova 2024-08-09 17:53:29 +01:00 committed by GitHub
parent 3f0ae5d23b
commit 5fff486c9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,41 +1,54 @@
job "nova-timetable" { job "nova-timetable" {
datacenters = ["aperture"] datacenters = ["aperture"]
type = "service"
type = "service"
group "nova-timetable" { group "nova-timetable" {
count = 1 count = 1
network { network {
port "http" {
to = 80
}
port "db" { port "db" {
to = 6379 to = 6379
} }
}
service { port "frontend" {
name = "nova-timetable" to = 3000
port = "http"
check {
type = "http"
path = "/healthcheck"
interval = "10s"
timeout = "2s"
} }
tags = [ port "backend" {
"traefik.enable=true", to = 4000
"traefik.http.routers.nova-timetable.rule=Host(`timetable.redbrick.dcu.ie`)", }
"traefik.http.routers.nova-timetable.entrypoints=web,websecure",
"traefik.http.routers.nova-timetable.tls.certresolver=lets-encrypt",
]
} }
task "python-application" { task "frontend" {
driver = "docker"
config {
image = "ghcr.io/novanai/timetable-sync-frontend:latest"
ports = ["frontend"]
}
service {
name = "nova-timetable-frontend"
port = "frontend"
check {
type = "http"
path = "/"
interval = "10s"
timeout = "2s"
}
tags = [
"traefik.enable=true",
"traefik.port=${NOMAD_PORT_frontend}",
"traefik.http.routers.nova-timetable-frontend.rule=Host(`timetable.redbrick.dcu.ie`)",
"traefik.http.routers.nova-timetable-frontend.entrypoints=web,websecure",
"traefik.http.routers.nova-timetable-frontend.tls.certresolver=lets-encrypt",
]
}
}
task "backend" {
driver = "docker" driver = "docker"
env { env {
@ -43,8 +56,28 @@ job "nova-timetable" {
} }
config { config {
image = "novanai/timetable-sync" image = "ghcr.io/novanai/timetable-sync-backend:latest"
ports = ["http"] ports = ["backend"]
}
service {
name = "nova-timetable-backend"
port = "backend"
check {
type = "http"
path = "/api/healthcheck"
interval = "10s"
timeout = "2s"
}
tags = [
"traefik.enable=true",
"traefik.port=${NOMAD_PORT_backend}",
"traefik.http.routers.nova-timetable-backend.rule=Host(`timetable.redbrick.dcu.ie`) && PathPrefix(`/api`)",
"traefik.http.routers.nova-timetable-backend.entrypoints=web,websecure",
"traefik.http.routers.nova-timetable-backend.tls.certresolver=lets-encrypt",
]
} }
} }