Creating and loading index after Elasticsearch docker container bootstrap

I am doing some development for which I am using Elasticsearch 6.7 in a docker container. Every time my container starts up I have to use 'curl' commands to create the index and then index the data stored in my json file. I would like this to happen automatically as part of container bootstrap. I have copied the Json data file and Json index mapping file into /usr/share/elasticsearch/ directory and I know that /usr/local/bin/docker-entrypoint.sh gets executed as part of docker startup command. Do I need to add curl calls into this entrypoint shell script or is there an elasticsearch command line tool that I can invoke to create index, upload the mappings, and index the data? For some reason curl is not working if I add it as last steps of entrypoint shell script.

Yes, there's no way for Elasticsearch to load things from file like that.