Linking Nodejs app container to elastic search container securely (Docker)

Elasitc search has no built in security so I need to handle it myself and the best way I thought of doing this to remove public access from it and only allow access from it through an API a node web application.

However I’m still able to access elastic search on port 0.0.0.0:9200, I basically only want the node application to be able to talk to elasticsearch.

  • Unable to connect to mongodb in docker container
  • How to move postgres into docker container?
  • What does the DOCKER_TLS_VERIFY and DOCKER_CERT_PATH variable do?
  • Running Redis with Docker (performance issue)
  • Kitematic: connecting to a docker machine with different name
  • Kubernetes Autoscaling Containers
  • version: "2"
    services:
      elasticsearch:
        image: elasticsearch
        ports:
          - "9200:9200"
      node-bot:
        build: .
        volumes:
          - "./dist:/dist"
        links:
          - elasticsearch
        ports:
          - "3030:3005"
        depends_on:
          - "elasticsearch"
    

    Hopefully that makes sense, thanks in advance.

  • Why isn't my postgres docker container mounting the database?
  • How to use environment variables in docker compose
  • Vagrant managed docker container doesn't start
  • env file-named volume in docker-compose
  • Is there any method I can modify the “IP” address without removing the docker container?
  • Error while executing mysql commands inside docker-compose
  • One Solution collect form web for “Linking Nodejs app container to elastic search container securely (Docker)”

    Just remove ports from elasticsearch definition

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.