Support mounting a Kalamar instance for local testing

Add an optional KALAMAR_INSTANCE variable to the `korap` target. When
set to a Kalamar-Instance-* checkout, its compose.instance.yaml overlay
is layered onto the fetched KorAP-Docker compose (via a second `-f`) and
its absolute path is exported as KALAMAR_INSTANCE_DIR, mounting the
instance's config and templates into the kalamar container:

    make korap KALAMAR_INSTANCE=../Kalamar-Instance-IDS

Without the variable the target behaves exactly as before. This project
keeps no knowledge of any particular instance -- the instance owns its
own mount map -- so instances stay independently updatable.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Change-Id: I4fd7d6474e05e43c95b0989e78724157c6afdb81
diff --git a/Makefile b/Makefile
index 99aeb4a..be1cfef 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,14 @@
 SRC_DIR ?= I5
 KORAP_PORT ?= 64543
 
+# Optional: path to a Kalamar-Instance-* checkout (e.g. ../Kalamar-Instance-IDS)
+# whose customizations (config, custom templates, plugins) should be mounted
+# into the kalamar container. The instance ships its own compose.instance.yaml
+# describing what to mount where, so this project needs no knowledge of it.
+#   make korap KALAMAR_INSTANCE=../Kalamar-Instance-IDS
+KALAMAR_INSTANCE ?=
+KALAMAR_INSTANCE_DIR := $(abspath $(KALAMAR_INSTANCE))
+
 # Discover all *.i5.xml files in SRC_DIR, excluding inlined tagged copies (*-TAG.i5.xml)
 I5_FILES := $(filter-out %-TAG.i5.xml,$(wildcard $(SRC_DIR)/*.i5.xml))
 BASENAMES := $(patsubst %.i5.xml,%,$(notdir $(I5_FILES)))
@@ -191,7 +199,7 @@
 	java -jar lib/Krill-Indexer.jar -c lib/krill.cfg --progress -i $(subst " ",;,$^) -o $@
 
 korap: check-src $(TARGET_DIR)/index
-	curl -s https://raw.githubusercontent.com/KorAP/KorAP-Docker/master/compose.yaml | sed 's/64543:64543/$(KORAP_PORT):64543/g' | COMPOSE_PROFILES='export,open,lite' INDEX='$(TARGET_DIR)/index' docker compose -p korap -f - up
+	curl -s https://raw.githubusercontent.com/KorAP/KorAP-Docker/master/compose.yaml | sed 's/64543:64543/$(KORAP_PORT):64543/g' | COMPOSE_PROFILES='export,open,lite' INDEX='$(TARGET_DIR)/index' $(if $(KALAMAR_INSTANCE),KALAMAR_INSTANCE_DIR='$(KALAMAR_INSTANCE_DIR)') docker compose -p korap -f - $(if $(KALAMAR_INSTANCE),-f '$(KALAMAR_INSTANCE_DIR)/compose.instance.yaml') up
 
 $(TARGET_DIR)/index.tar.xz: $(TARGET_DIR)/index
 	tar -I 'xz -T0' -C $(dir $<) -cf $@ $(notdir $<)
diff --git a/Readme.md b/Readme.md
index 134af2a..180924d 100644
--- a/Readme.md
+++ b/Readme.md
@@ -26,6 +26,22 @@
 
 Then open the corresponding URL (e.g., http://localhost:64544) in your browser.
 
+### Testing a Kalamar instance's customizations
+
+By default the KorAP UI comes up as stock Kalamar. To test the config and
+templates of a separate `Kalamar-Instance-*` checkout (e.g. the IDS instance,
+with its custom corpus/doc pages, navigation and localization), point
+`KALAMAR_INSTANCE` at that checkout:
+
+```bash
+make korap KALAMAR_INSTANCE=../Kalamar-Instance-IDS
+```
+
+The instance ships a `compose.instance.yaml` describing which of its files are
+mounted where in the `kalamar` container, so this project needs no knowledge of
+any particular instance and the instance can be kept up to date independently
+(`git pull` in its checkout). Combine with `KORAP_PORT` as usual.
+
 ### Standard TEI P5 Support
 
 Standard TEI P5 files (which typically contain one text per file) can be batch-converted together. By default, place your `.xml` files in the `TEI` directory in the root of the project: