Kavita deploy

This commit is contained in:
Luigi Oliveira 2024-11-18 17:21:48 -03:00
parent 8a704dba3d
commit e1428f8900
6 changed files with 96 additions and 1 deletions

View file

@ -52,6 +52,14 @@ module "twitchminer" {
discord_webhook = var.discord_webhook
twitch_username = var.twitch_username
twitch_password = var.twitch_password
providers = {
nomad = nomad
}
}
module "kavita" {
source = "./modules/kavita"
providers = {
nomad = nomad
}

View file

@ -56,3 +56,14 @@ keycloak.lab.marioverde.com.br {
}
}
kavita.lab.marioverde.com.br {
encode gzip
reverse_proxy "${endpoint}:5002" {
header_up X-Forwarded-Host {host}:5002
header_up -Origin
header_up -Referer
}
tls {
dns cloudflare "${cloudflare_api_token}"
}
}

View file

@ -0,0 +1,63 @@
job "kavita" {
datacenters = ["dc"]
type = "service"
group "kavita" {
count = 1
network {
port "kavita" {
static = 5002
to = 5000
}
}
restart {
attempts = 2
interval = "5m"
delay = "30s"
mode = "delay"
}
task "kavita" {
driver = "docker"
config {
image = "jvmilazz0/kavita:latest"
ports = ["kavita"]
volumes = [
"${NOMAD_ALLOC_DIR}/kavita/manga:/manga",
"${NOMAD_ALLOC_DIR}/kavita/comics:/comics",
"${NOMAD_ALLOC_DIR}/kavita/books:/books",
"${NOMAD_ALLOC_DIR}/kavita/config:/kavita/config"
]
}
env {
TZ = "America/Sao_Paulo"
}
resources {
cpu = 500
memory = 512
}
service {
name = "kavita"
port = "kavita"
provider = "nomad"
check {
type = "http"
path = "/"
interval = "10s"
timeout = "2s"
}
}
logs {
max_files = 5
max_file_size = 15
}
}
}
}

View file

@ -0,0 +1,5 @@
resource "nomad_job" "kavita" {
jobspec = templatefile("${path.module}/conf/kavita.hcl", {
NOMAD_ALLOC_DIR = "/alloc"
})
}

View file

@ -0,0 +1,9 @@
terraform {
required_providers {
nomad = {
source = "hashicorp/nomad"
version = "2.0.0-rc.1"
}
}
required_version = ">= 0.14"
}

View file

@ -5,7 +5,6 @@ resource "nomad_job" "app_postgree" {
POSTGREE_PASSWORD = var.postgree_password
})
}
resource "nomad_job" "app_pgadmin" {
jobspec = templatefile("${path.module}/conf/pgadmin.hcl", {
NOMAD_ALLOC_DIR = "/alloc"