This commit is contained in:
Stefan Hardegger
2026-07-20 12:17:51 +02:00
parent dca6ddadd5
commit f7eabe1761
2 changed files with 15 additions and 16 deletions

View File

@@ -13,11 +13,12 @@ COPY <<EOF /docker-entrypoint-initdb.d/init-cores.sh
#!/bin/bash
echo "StoryCove: Initializing cores..."
# Always sync configsets to the persistent volume so CoreAdmin CREATE works at runtime
# (needed after unloadCore + recreate without restarting the container)
mkdir -p /var/solr/data/configsets
# Repair any cores that are missing core.properties (e.g. after a failed API recreation)
for core in storycove_stories storycove_authors storycove_collections; do
cp -rf /opt/solr-9.9.0/server/solr/configsets/\$core /var/solr/data/configsets/
if [ -d "/var/solr/data/\$core" ] && [ ! -f "/var/solr/data/\$core/core.properties" ]; then
echo "Repairing broken core: \$core (missing core.properties)"
rm -rf "/var/solr/data/\$core"
fi
done
# Create cores on first startup (no-op if they already exist)