poststartup script moved to extra container, non init

This commit is contained in:
Leo Sok 2025-07-24 13:53:09 +03:00
parent 1be00f2726
commit d7667e7c11

View File

@ -193,7 +193,6 @@ extraContainers:
for idx in "chat:$TEMPLATE_PATH_1" "message:$TEMPLATE_PATH_2" "user:$TEMPLATE_PATH_3"; do for idx in "chat:$TEMPLATE_PATH_1" "message:$TEMPLATE_PATH_2" "user:$TEMPLATE_PATH_3"; do
name="${idx%%:*}" name="${idx%%:*}"
path="${idx##*:}" path="${idx##*:}"
# Check if index exists
if curl -sf -o /dev/null "$ES_URL/$name"; then if curl -sf -o /dev/null "$ES_URL/$name"; then
echo "[template-loader] Index $name already exists. Skipping." echo "[template-loader] Index $name already exists. Skipping."
else else
@ -203,8 +202,8 @@ extraContainers:
--data-binary @"$path" --data-binary @"$path"
fi fi
done done
echo "[template-loader] All templates applied (or skipped). Exiting." echo "[template-loader] All templates applied (or skipped). Going to sleep to prevent container exit."
sleep infinity
env: env:
- name: ES_URL - name: ES_URL
value: "http://elasticsearch-master:9200" value: "http://elasticsearch-master:9200"