Docker-Compose doesn't map ports to host machine

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

it is maybe worth a try to test it with Jerome’s Workshop. This one works on my and Jerome’s machine.
Later you also can try to execute your example on http://play-with-docker.com to be sure that the issue is not caused by your local installation.

I tried a simple hello world docker-compose file and that worked just fine. Mapped to the port perfectly and I could view it. Idk what is wrong with mine…