Kafkatorio/modules/infra-kafka-cluster/build.gradle.kts
Lazzexus e52ea9d9cf Fix Docker image builds and local platform setup
Getting the backend running locally in Docker surfaced several issues:

- geedeecee: REGISTRY_HOST came from the unset Gradle property
  'dockerContainerRegistryHost'. A missing value in a MapProperty makes
  the whole map absent, so every generated .env was empty and all
  docker-compose builds failed. Default it to 'localhost'.
- kafka image: dlcdn.apache.org only hosts current releases, so Kafka
  3.3.1 404s. Use archive.apache.org. Replace the deprecated openjdk:11
  base with eclipse-temurin:11-jre, bump the download stage from EOL
  Debian 11 to 12, and drop 'COPY --chmod' so the image builds without
  BuildKit/buildx.
- web-map: the map calls the API and websocket on its own origin
  (/kafkatorio/...), which previously relied on an external reverse
  proxy. Proxy /kafkatorio/ to events-server-web in the map's nginx so
  one port serves everything, and publish that port in the example
  platform compose file.
- docs: the example secret config mapped server IDs to descriptions,
  but the schema is token (JWT 'sub') -> server ID, and both must match
  [a-zA-Z0-9-_]. Descriptions with spaces crashed every service.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:27:11 +02:00

42 lines
1.2 KiB
Kotlin

plugins {
id("kafkatorio.conventions.base")
id("dev.adamko.geedeecee")
}
description = "Kafka cluster"
geedeecee {
srcDir.set(layout.projectDirectory.dir("src"))
}
tasks.dockerComposeEnvUpdate {
envProperties {
put("GRAFANA_VERSION", libs.versions.grafana)
put("PROMETHEUS_VERSION", libs.versions.prometheus)
put("KAFKA_VERSION", libs.versions.kafka)
put("KAFKA_DL_URL", libs.versions.kafka.map { ver ->
"https://archive.apache.org/dist/kafka/$ver/kafka_2.13-$ver.tgz"
})
put("APP_NAME", "kafka-kraft")
}
// Limit JVM Heap Size
// "KAFKA_BROKER_HEAP_OPTS" to "-XX:MaxRAMPercentage=70.0",
// "KAFKA_CONNECT_HEAP_OPTS" to "-XX:MaxRAMPercentage=70.0",
// "SCHEMA_REGISTRY_HEAP_OPTS" to "-XX:MaxRAMPercentage=70.0",
// "KAFKA_KSQL_HEAP_OPTS" to "-XX:MaxRAMPercentage=70.0",
// "PROMETHEUS_JMX_AGENT_JVM_OPTS" to "-Xmx128M",
// // Limit container resources
// "KAFKA_BROKER_MEM_LIMIT" to "512m",
// "KAFKA_CONNECT_MEM_LIMIT" to "512m",
// "KAFKA_KSQL_MEM_LIMIT" to "256m",
// "SCHEMA_REGISTRY_MEM_LIMIT" to "256m",
// )
}
val runKafkaCluster by tasks.registering {
group = rootProject.name
dependsOn(tasks.dockerComposeUp)
}