Could not resolve placeholder ‘ES_PWD in Elasticsearch in docker-compose

I am not sure why i am hitting this error. i am using current version of docker-compose

version: "3.9"
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.14
    secrets:
      - ES_PASSWORD
    volumes:
      - type: bind
        source: ./config/elasticsearch.yml
        target: /usr/share/elasticsearch/config/elasticsearch.yml


secrets:
  ES_PASSWORD:
    file: ./.myfile

myfile

ES_PWD: myPassword

elasticsearch.yml

xpack.security.transport.ssl.keystore.password: ${ES_PWD}

Source: Docker Questions

LEAVE A COMMENT