# ===================================================================
# Docker Versions Catalog - Single Source of Truth
# Analogous to gradle/libs.versions.toml for centralized version management
# ===================================================================
# Last updated: 2025-09-13
# Eliminates version redundancy across 12+ Dockerfiles

[versions]
# --- Build Tools ---
gradle = "9.0.0"
java = "21"
node = "20.12.0"

# --- Base Images ---
nginx = "1.25-alpine"
alpine = "3.19"
eclipse-temurin-jdk = "21-jdk-alpine"
eclipse-temurin-jre = "21-jre-alpine"

# --- Monitoring & Infrastructure Services ---
prometheus = "v2.54.1"
grafana = "11.3.0"
keycloak = "26.0.7"

# --- Spring Configuration ---
spring-profiles-default = "default"
spring-profiles-docker = "docker"
spring-profiles-prod = "prod"

# --- Application Versions ---
app-version = "1.0.0"

# --- Zentrale Port-Verwaltung ---
# Single Source of Truth für alle Service-Ports

[service-ports]
# --- Infrastructure Services ---
api-gateway = 8081
auth-server = 8087
monitoring-server = 8088

# --- Application Services ---
ping-service = 8082
members-service = 8083
horses-service = 8084
events-service = 8085
masterdata-service = 8086

# --- External Services ---
postgres = 5432
redis = 6379
keycloak = 8180
consul = 8500
zookeeper = 2181
kafka = 9092

# --- Monitoring Stack ---
prometheus = 9090
grafana = 3000

# --- Client Applications ---
web-app = 4000
desktop-app-vnc = 5901
desktop-app-novnc = 6080

[port-ranges]
# --- Port-Range-Definitionen für automatische Port-Zuweisung ---
infrastructure = "8081-8088"
services = "8082-8099"
monitoring = "9090-9099"
clients = "4000-4099"
vnc = "5901-5999"
debug = "5005-5009"

# --- Reserved Port Ranges ---
system-reserved = "0-1023"
ephemeral = "32768-65535"

[build-args]
# --- Global Build Arguments (used across all categories) ---
global = [
    "GRADLE_VERSION",
    "JAVA_VERSION",
    "BUILD_DATE",
    "VERSION"
]

# --- Spring Boot Services (dockerfiles/services/* and infrastructure/*) ---
spring-services = [
    "SPRING_PROFILES_ACTIVE",
    "SERVICE_PATH",
    "SERVICE_NAME",
    "SERVICE_PORT"
]

# --- Kotlin/JS Web Clients (dockerfiles/clients/*) ---
web-clients = [
    "NODE_VERSION",
    "NGINX_VERSION",
    "CLIENT_PATH",
    "CLIENT_MODULE",
    "CLIENT_NAME"
]

[categories]
# --- Services Configuration ---
[categories.services]
default-spring-profile = "docker"
default-port-start = 8082
services = [
    "ping-service",
    "members-service",
    "horses-service",
    "events-service",
    "masterdata-service"
]

# --- Infrastructure Configuration ---
[categories.infrastructure]
default-spring-profile = "default"
services = [
    "gateway",
    "auth-server",
    "monitoring-server"
]

# --- Client Applications Configuration ---
[categories.clients]
default-node-version = "20.11.0"
default-nginx-version = "1.25-alpine"
clients = [
    "web-app",
    "desktop-app"
]

[environment-mapping]
# --- Environment Variable Names for Docker Compose ---
# Maps internal version names to environment variable names
gradle-version = "DOCKER_GRADLE_VERSION"
java-version = "DOCKER_JAVA_VERSION"
node-version = "DOCKER_NODE_VERSION"
nginx-version = "DOCKER_NGINX_VERSION"
prometheus-version = "DOCKER_PROMETHEUS_VERSION"
grafana-version = "DOCKER_GRAFANA_VERSION"
keycloak-version = "DOCKER_KEYCLOAK_VERSION"
spring-profiles-default = "DOCKER_SPRING_PROFILES_DEFAULT"
spring-profiles-docker = "DOCKER_SPRING_PROFILES_DOCKER"
app-version = "DOCKER_APP_VERSION"

[environments]
# --- Environment-spezifische Konfigurationen ---
# Zentrale Verwaltung für dev/test/prod Umgebungen

[environments.development]
spring-profiles = "dev"
debug-enabled = true
log-level = "DEBUG"
health-check-interval = "30s"
health-check-timeout = "5s"
health-check-retries = 3
health-check-start-period = "40s"
resource-limits = false
jvm-debug-port = 5005
hot-reload = true

[environments.production]
spring-profiles = "prod"
debug-enabled = false
log-level = "INFO"
health-check-interval = "15s"
health-check-timeout = "3s"
health-check-retries = 3
health-check-start-period = "30s"
resource-limits = true
jvm-debug-port = false
hot-reload = false
security-headers = true
tls-enabled = true

[environments.testing]
spring-profiles = "test"
debug-enabled = true
log-level = "DEBUG"
health-check-interval = "10s"
health-check-timeout = "5s"
health-check-retries = 2
health-check-start-period = "20s"
resource-limits = false
jvm-debug-port = 5005
hot-reload = false
ephemeral-storage = true
test-containers = true
