mirror of
https://github.com/luigieai/homelab.git
synced 2025-06-06 07:36:37 -03:00
Kavita deploy
This commit is contained in:
parent
8a704dba3d
commit
e1428f8900
6 changed files with 96 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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}"
|
||||
}
|
||||
}
|
63
terraform/modules/kavita/conf/kavita.hcl
Normal file
63
terraform/modules/kavita/conf/kavita.hcl
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
5
terraform/modules/kavita/job.tf
Normal file
5
terraform/modules/kavita/job.tf
Normal file
|
@ -0,0 +1,5 @@
|
|||
resource "nomad_job" "kavita" {
|
||||
jobspec = templatefile("${path.module}/conf/kavita.hcl", {
|
||||
NOMAD_ALLOC_DIR = "/alloc"
|
||||
})
|
||||
}
|
9
terraform/modules/kavita/providers.tf
Normal file
9
terraform/modules/kavita/providers.tf
Normal file
|
@ -0,0 +1,9 @@
|
|||
terraform {
|
||||
required_providers {
|
||||
nomad = {
|
||||
source = "hashicorp/nomad"
|
||||
version = "2.0.0-rc.1"
|
||||
}
|
||||
}
|
||||
required_version = ">= 0.14"
|
||||
}
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue