version: '2'
services:
elasticsearch_service:
image: docker.elastic.co/elasticsearch/elasticsearch:5.4.2
container_name: es_webapp
network_mode: "bridge"
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- xpack.security.enabled=true
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 3g
volumes:
- /usr/share/elasticsearch/data
webapp_service:
image: webapp
network_mode: "bridge"
depends_on:
- "elasticsearch_service"
ports:
- "3000:3000"
links:
- "elasticsearch_service:es"
- "kibana_service:kb"
command: bash -c "bash create_perms.sh; npm start"
kibana_service:
image: docker.elastic.co/kibana/kibana:5.4.2
container_name: kibana_webapp
network_mode: "bridge"
environment:
- ELASTICSEARCH_URL=http://es:9200
depends_on:
- "elasticsearch_service"
links:
- "elasticsearch_service:es"
This is my docker-compose.yml
docker-compose ps shows that the port is mapped to the host port that is specified in the file but I cannot access it in anyway on my machine. I tried all the other options for network_mode
but nothing is working