FEATURE: Add ECO service for friends

This commit is contained in:
2026-04-15 17:38:16 +00:00
parent 46271535f5
commit f969b1728e
4 changed files with 109 additions and 0 deletions
@@ -0,0 +1,68 @@
terraform {
required_providers {
dotenv = {
source = "germanbrew/dotenv"
}
}
}
locals {
container_name = "eco"
eco_image = "docker.io/strangeloopgames/eco-game-server"
eco_tag = var.image_tag
env_file = "${path.module}/.env"
eco_internal_port = 3000
}
module "eco" {
source = "../../10-generic/docker-service"
container_name = local.container_name
image = local.eco_image
tag = local.eco_internal_port
networks = var.networks
restart_policy = "always"
ports = [
{
internal = 3000
external = 3000
protocol = "udp"
},
{
internal = 3001
external = 3001
protocol = "tcp"
}
]
volumes = [
{
host_path = "${var.volume_path}/${local.container_name}/config"
container_path = "/app/Configs/"
read_only = false
},
{
host_path = "${var.volume_path}/${local.container_name}/data"
container_path = "/app/Storage/"
read_only = false
},
{
host_path = "${var.volume_path}/${local.container_name}/mods"
container_path = "/app/Mods/"
read_only = false
},
]
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.eco_internal_port
endpoint = "http://${local.container_name}:${local.eco_internal_port}"
}
}
@@ -0,0 +1,34 @@
variable "image_tag" {
description = "The tag for the Eco 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"
}
+6
View File
@@ -31,6 +31,12 @@ module "satisfactory" {
networks = [module.infrastructure_int.name] networks = [module.infrastructure_int.name]
} }
module "eco" {
source = "${local.module_dir}/20-services-entertainment/eco-service"
volume_path = "${local.root_volume}/eco"
networks = [module.infrastructure_int.name]
}
module "authentik" { module "authentik" {
source = "${local.module_dir}/30-services-software/authentik-service" source = "${local.module_dir}/30-services-software/authentik-service"
volume_path = "${local.root_volume}/authentik" volume_path = "${local.root_volume}/authentik"
+1
View File
@@ -3,6 +3,7 @@ output "service_definitions" {
value = [ value = [
module.jellyfin.service_definition, module.jellyfin.service_definition,
module.satisfactory.service_definition, module.satisfactory.service_definition,
module.eco.service_definition,
module.authentik.service_definition, module.authentik.service_definition,
module.traccar.service_definition, module.traccar.service_definition,
module.tandoor.service_definition, module.tandoor.service_definition,