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.

  • How to forward USB device to Docker from Mac by ID?
  • How to set different static IPs to each docker containers with in the same host?
  • docker container not finding the unix socket
  • How to find the CMD command of a docker image?
  • How to use the forever CLI in Docker?
  • Woocommerce webhook debugging on nginx in a docker container
  • 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.

  • Permission denied inside Docker container
  • How do I configure Docker to work with my ens34 network interface (instead of eth0)?
  • How to run application from docker container from host OS?
  • Run docker image with docker-compose
  • Create named docker volume with docker-compose?
  • Kafka setup with docker using kafka-rb for clients
  • 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.