MySQL Connector cannot connect to Elasticsearch Docker Instance

Are these 2 separate containers? if so localhost to connect to each other... will not work as 1 container's localhost is separate from the other container's localhost

Perhaps take a look at

in short, you will probably need to use host.docker.internal between the two containers