diff --git a/lila-docker b/lila-docker index dd7a3a98..e453b1af 100755 --- a/lila-docker +++ b/lila-docker @@ -96,13 +96,6 @@ setup_database() { sleep 1 done - if [[ $COMPOSE_PROFILES == *"search"* ]]; then - while ! docker compose exec elasticsearch curl -s -X GET "http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=10s" > /dev/null 2>&1; do - echo "Waiting for elasticsearch to be ready..." - sleep 2 - done - fi - [[ $SETUP_API_TOKENS == "true" ]] && params+=(--tokens) docker compose run --rm python python /lila-db-seed/spamdb/spamdb.py \ @@ -112,7 +105,6 @@ setup_database() { --su-password=$SU_PASSWORD \ --streamers \ --coaches \ - --es --es-host=elasticsearch:9200 \ "${params[@]}" echo -n "Creating database indexes..." @@ -123,6 +115,16 @@ setup_database() { docker compose exec mongodb mongosh --quiet lichess /lila/bin/mongodb/create-trophy-kinds.js echo " done" + if [[ $COMPOSE_PROFILES == *"search"* ]]; then + while ! docker compose exec elasticsearch curl -s -X GET "http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=10s" > /dev/null 2>&1; do + echo "Waiting for elasticsearch to be ready..." + sleep 2 + done + + curl -X DELETE "localhost:9200/_all?pretty" + docker compose exec lila_search_ingestor sbt 'ingestor/runMain lila.search.ingestor.cli index --all --since 0' + fi + docker compose run --rm python python /scripts/users.py }