Add traccar and revert *-test moniker
This commit is contained in:
@@ -7,7 +7,7 @@ terraform {
|
||||
}
|
||||
|
||||
locals {
|
||||
container_name = "jellyfin-test"
|
||||
container_name = "jellyfin"
|
||||
jellyfin_image = "docker.io/jellyfin/jellyfin"
|
||||
jellyfin_tag = var.image_tag
|
||||
env_file = "${path.module}/.env"
|
||||
|
||||
@@ -7,7 +7,7 @@ terraform {
|
||||
}
|
||||
|
||||
locals {
|
||||
container_name = "authentik-test"
|
||||
container_name = "authentik"
|
||||
redis_container_name = "authentik-redis"
|
||||
postgres_container_name = "authentik-postgres"
|
||||
authentik_image = "ghcr.io/goauthentik/server"
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
dotenv = {
|
||||
source = "germanbrew/dotenv"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
locals {
|
||||
container_name = "traccar"
|
||||
calibre_image = "docker.io/traccar/traccar"
|
||||
calibre_tag = var.image_tag
|
||||
calibre_internal_port = 8082
|
||||
|
||||
calibre_env_vars = {
|
||||
PUID = var.user_id
|
||||
PGID = var.group_id
|
||||
TZ = var.timezone
|
||||
}
|
||||
|
||||
traccar_content = <<-EOT
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>
|
||||
<properties>
|
||||
<!-- Documentation: https://www.traccar.org/configuration-file/ -->
|
||||
|
||||
<entry key='database.driver'>org.h2.Driver</entry>
|
||||
<entry key='database.url'>jdbc:h2:./data/database</entry>
|
||||
<entry key='database.user'>sa</entry>
|
||||
<entry key='database.password'></entry>
|
||||
</properties>
|
||||
EOT
|
||||
}
|
||||
|
||||
resource "local_file" "caddyfile" {
|
||||
content = local.traccar_content
|
||||
filename = "${var.volume_path}/${local.container_name}/traccar.xml"
|
||||
}
|
||||
|
||||
module "calibre" {
|
||||
source = "../../10-generic/docker-service"
|
||||
container_name = local.container_name
|
||||
image = local.calibre_image
|
||||
tag = local.calibre_tag
|
||||
volumes = [
|
||||
{
|
||||
host_path = "${var.volume_path}/${local.container_name}/logs"
|
||||
container_path = "/opt/traccar/logs"
|
||||
read_only = false
|
||||
},{
|
||||
host_path = "${var.volume_path}/${local.container_name}/data"
|
||||
container_path = "/opt/traccar/data"
|
||||
read_only = false
|
||||
},{
|
||||
host_path = "${var.volume_path}/${local.container_name}/traccar.xml"
|
||||
container_path = "/opt/traccar/conf/traccar.xml"
|
||||
read_only = true
|
||||
},
|
||||
]
|
||||
env_vars = local.calibre_env_vars
|
||||
networks = concat(var.networks)
|
||||
restart_policy = "always"
|
||||
}
|
||||
|
||||
output "service_definition" {
|
||||
description = "General service definition with optional ingress configuration"
|
||||
value = {
|
||||
name = local.container_name
|
||||
primary_port = local.calibre_internal_port
|
||||
endpoint = "http://${local.container_name}:${local.calibre_internal_port}"
|
||||
subdomains = ["maps"]
|
||||
is_guarded = true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
variable "image_tag" {
|
||||
description = "The tag for the JellyFin container image. Default: Latest"
|
||||
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 = []
|
||||
}
|
||||
|
||||
variable "user_id" {
|
||||
description = "User ID for container permissions"
|
||||
type = string
|
||||
default = "1000"
|
||||
}
|
||||
|
||||
variable "group_id" {
|
||||
description = "Group ID for container permissions"
|
||||
type = string
|
||||
default = "1000"
|
||||
}
|
||||
|
||||
variable "timezone" {
|
||||
description = "Timezone for the container"
|
||||
type = string
|
||||
default = "Europe/Helsinki"
|
||||
}
|
||||
@@ -24,6 +24,14 @@ module "authentik" {
|
||||
]
|
||||
}
|
||||
|
||||
module "traccar" {
|
||||
source = "${local.module_dir}/30-services-software/traccar-service"
|
||||
volume_path = "${local.root_volume}/traccar"
|
||||
networks = [
|
||||
"blue",
|
||||
]
|
||||
}
|
||||
|
||||
module "jellyfin" {
|
||||
source = "${local.module_dir}/20-services-entertainment/jellyfin-service"
|
||||
volume_path = "${local.root_volume}/jellyfin"
|
||||
|
||||
@@ -3,6 +3,7 @@ output "service_definitions" {
|
||||
value = [
|
||||
module.jellyfin.service_definition,
|
||||
module.calibre.service_definition,
|
||||
module.traccar.service_definition,
|
||||
module.authentik.service_definition,
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user