feat: add searxng
This commit is contained in:
59
modules/20-services-apps/searxng/main.tf
Normal file
59
modules/20-services-apps/searxng/main.tf
Normal file
@@ -0,0 +1,59 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
dotenv = {
|
||||
source = "germanbrew/dotenv"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
variable "image_tag" {
|
||||
description = "The tag for the searxng container image"
|
||||
type = string
|
||||
default = "latest"
|
||||
}
|
||||
|
||||
variable "volume_path" {
|
||||
description = "Base directory for volumes"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "networks" {
|
||||
description = "List of networks to which the container should be attached"
|
||||
type = list(string)
|
||||
default = []
|
||||
}
|
||||
|
||||
locals {
|
||||
container_name = "searxng"
|
||||
image = "searxng/searxng"
|
||||
tag = var.image_tag != "" ? var.image_tag : "latest"
|
||||
monitoring = true
|
||||
internal_port = 8080
|
||||
volumes = [
|
||||
{
|
||||
host_path = "${var.volume_path}/config"
|
||||
container_path = "/etc/searxng"
|
||||
read_only = false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
module "searxng" {
|
||||
source = "../../10-services-generic/docker-service"
|
||||
container_name = local.container_name
|
||||
image = local.image
|
||||
tag = local.tag
|
||||
volumes = local.volumes
|
||||
networks = var.networks
|
||||
monitoring = local.monitoring
|
||||
}
|
||||
|
||||
output "service_definition" {
|
||||
description = "Service definition with ingress configuration"
|
||||
value = {
|
||||
name = local.container_name
|
||||
primary_port = local.internal_port
|
||||
endpoint = "http://${local.container_name}:${local.internal_port}"
|
||||
subdomains = ["search"]
|
||||
}
|
||||
}
|
||||
@@ -58,3 +58,9 @@ module "n8n" {
|
||||
volume_path = "${local.volume_host}/n8n"
|
||||
networks = [module.homelab_docker_network.name]
|
||||
}
|
||||
|
||||
module "searxng" {
|
||||
source = "${local.module_dir}/20-services-apps/searxng"
|
||||
volume_path = "${local.volume_host}/searxng"
|
||||
networks = [module.homelab_docker_network.name]
|
||||
}
|
||||
|
||||
@@ -10,7 +10,8 @@ output "service_definitions" {
|
||||
module.ntfy.service_definition,
|
||||
module.pterodactyl_wings.service_definition,
|
||||
module.pterodactyl_panel.service_definition,
|
||||
module.n8n.service_definition
|
||||
module.n8n.service_definition,
|
||||
module.searxng.service_definition
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user