Elasticsearch create index using docker compose
I would like to set elasticsearch locally using docker-compose.yaml
file with default index products
.
My docker-compose.yaml
file looks like this:
version: '3.1'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.0
container_name: es
environment:
- discovery.type=single-node
ports:
- 9200:9200
deploy:
resources:
limits:
memory: 2GB
How can I create index on elasticsearch during running docker compose up -d
instead of creating it manually?