poststartup script moved to extra container, non init

This commit is contained in:
Leo Sok 2025-07-24 13:25:40 +03:00
parent ffc784d4cd
commit 30cf1c8fe3

View File

@ -179,7 +179,7 @@ extraContainers:
- /bin/bash
- -c
- |
set -ex
set -ex
echo "[template-loader] Waiting for Elasticsearch at $ES_URL..."
for i in $(seq 1 ${MAX_RETRIES:-30}); do
if curl -s "$ES_URL" >/dev/null; then
@ -189,12 +189,12 @@ extraContainers:
echo "[template-loader] Attempt $i: ES not ready, sleeping..."
sleep "${RETRY_INTERVAL:-5}"
done
echo "[template-loader] Applying templates..."
echo "[template-loader] Applying index templates..."
for idx in "chat:$TEMPLATE_PATH_1" "message:$TEMPLATE_PATH_2" "user:$TEMPLATE_PATH_3"; do
name="${idx%%:*}"
path="${idx##*:}"
echo "[template-loader] Applying $name from $path..."
curl -X PUT "$ES_URL/$name" \
echo "[template-loader] Applying template: $name from $path..."
curl -X PUT "$ES_URL/_index_template/$name" \
-H 'Content-Type: application/json' \
--data-binary @"$path"
done