-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Elastisearch docker-compose for offline tests
- Loading branch information
Svana
committed
Nov 22, 2024
1 parent
1a4eea6
commit 9cf35bf
Showing
3 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
version: '3' | ||
services: | ||
elasticsearch: | ||
image: docker.io/elasticsearch:8.8.0 | ||
ports: | ||
- 9200:9200 | ||
- 9300:9300 | ||
environment: | ||
- discovery.type=single-node | ||
- xpack.security.enabled=false | ||
healthcheck: | ||
test: ['CMD-SHELL', 'curl -f http://localhost:9200 || exit 1'] | ||
interval: 10s | ||
retries: 10 | ||
|
||
init-elasticsearch: | ||
image: docker.io/curlimages/curl:7.85.0 | ||
depends_on: | ||
elasticsearch: | ||
condition: service_healthy | ||
entrypoint: > | ||
sh -c " | ||
until curl -s http://elasticsearch:9200; do | ||
echo 'Waiting for Elasticsearch...'; | ||
sleep 5; | ||
done; | ||
curl -X PUT 'http://elasticsearch:9200/island-is-kstnl' -H 'Content-Type: application/json' -d' | ||
{ | ||
\"settings\": { | ||
\"number_of_shards\": 1, | ||
\"number_of_replicas\": 1 | ||
}, | ||
\"mappings\": { | ||
\"properties\": { | ||
\"title\": { | ||
\"type\": \"text\", | ||
\"fields\": { | ||
\"sort\": { | ||
\"type\": \"keyword\" | ||
} | ||
} | ||
}, | ||
\"dateUpdated\": { | ||
\"type\": \"date\" | ||
}, | ||
\"dateCreated\": { | ||
\"type\": \"date\" | ||
}, | ||
\"releaseDate\": { | ||
\"type\": \"date\" | ||
}, | ||
\"tags\": { | ||
\"type\": \"nested\", | ||
\"properties\": { | ||
\"key\": { | ||
\"type\": \"keyword\" | ||
}, | ||
\"type\": { | ||
\"type\": \"keyword\" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}'; | ||
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters