From 7c4ca2cdc620b5d71c4c56f390affb72137364d1 Mon Sep 17 00:00:00 2001 From: Jeroen Vijgen Date: Thu, 2 Apr 2026 13:05:15 +0000 Subject: [PATCH] feature: Add satisfactory to homelab --- .../satisfactory-service/.env.example | 4 ++ .../satisfactory-service/main.tf | 49 +++++++++++++++++++ .../satisfactory-service/variable.tf | 34 +++++++++++++ services/main.tf | 9 +++- services/outputs.tf | 1 + 5 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 modules/20-services-entertainment/satisfactory-service/.env.example create mode 100644 modules/20-services-entertainment/satisfactory-service/main.tf create mode 100644 modules/20-services-entertainment/satisfactory-service/variable.tf diff --git a/modules/20-services-entertainment/satisfactory-service/.env.example b/modules/20-services-entertainment/satisfactory-service/.env.example new file mode 100644 index 0000000..2ddb397 --- /dev/null +++ b/modules/20-services-entertainment/satisfactory-service/.env.example @@ -0,0 +1,4 @@ +MAXPLAYERS=16 +PGID=1000 +PUID=1000 +STEAMBETA=false \ No newline at end of file diff --git a/modules/20-services-entertainment/satisfactory-service/main.tf b/modules/20-services-entertainment/satisfactory-service/main.tf new file mode 100644 index 0000000..277bc37 --- /dev/null +++ b/modules/20-services-entertainment/satisfactory-service/main.tf @@ -0,0 +1,49 @@ +terraform { + required_providers { + dotenv = { + source = "germanbrew/dotenv" + } + } +} + +locals { + container_name = "satisfactory" + satisfactory_image = "ghcr.io/wolveix/satisfactory-server" + satisfactory_tag = var.image_tag + env_file = "${path.module}/.env" + satisfactory_internal_port = 7777 +} + + + +module "satisfactory" { + source = "../../10-generic/docker-service" + container_name = local.container_name + image = local.satisfactory_image + tag = local.satisfactory_tag + networks = var.networks + restart_policy = "always" + memory_limit = 16000 // 16Gb + volumes = [ + { + host_path = "${var.volume_path}/${local.container_name}/config" + container_path = "/config" + read_only = true + }, + ] + env_vars = { + MAXPLAYERS = provider::dotenv::get_by_key("MAXPLAYERS", local.env_file) + PUID = var.user_id + PGID = var.group_id + } +} + +output "service_definition" { + description = "General service definition with optional ingress configuration" + value = { + name = local.container_name + primary_port = local.satisfactory_internal_port + endpoint = "http://${local.container_name}:${local.satisfactory_internal_port}" + subdomains = ["satisfactory"] + } +} diff --git a/modules/20-services-entertainment/satisfactory-service/variable.tf b/modules/20-services-entertainment/satisfactory-service/variable.tf new file mode 100644 index 0000000..797691c --- /dev/null +++ b/modules/20-services-entertainment/satisfactory-service/variable.tf @@ -0,0 +1,34 @@ +variable "image_tag" { + description = "The tag for the Satisfactory 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" +} diff --git a/services/main.tf b/services/main.tf index 4f83965..03db117 100644 --- a/services/main.tf +++ b/services/main.tf @@ -25,6 +25,12 @@ module "jellyfin" { networks = [module.infrastructure_int.name] } +module "satisfactory" { + source = "${local.module_dir}/20-services-entertainment/satisfactory-service" + volume_path = "${local.root_volume}/satisfactory" + networks = [module.infrastructure_int.name] +} + module "authentik" { source = "${local.module_dir}/30-services-software/authentik-service" volume_path = "${local.root_volume}/authentik" @@ -59,4 +65,5 @@ module "fs-quantum" { source = "${local.module_dir}/30-services-software/filesystem-service" volume_path = "${local.root_volume}/fs-quantum" networks = [module.infrastructure_int.name] -} \ No newline at end of file +} + diff --git a/services/outputs.tf b/services/outputs.tf index 5f380d3..62171e5 100644 --- a/services/outputs.tf +++ b/services/outputs.tf @@ -2,6 +2,7 @@ output "service_definitions" { description = "Service definitions for all services" value = [ module.jellyfin.service_definition, + module.satisfactory.service_definition, module.authentik.service_definition, module.traccar.service_definition, module.tandoor.service_definition,