Your Location is: Home > Docker-compose

TestNG docker-compose can not find localhost url

From: Nuku′alofa View: 4554 nonyck 

Question

I have this docker-compose configuration

version: '3'
services:
  selenoid:
    image: "aerokube/selenoid:latest"
    container_name: selenoid
    ports:
      - "0.0.0.0:4444:4444"
    networks:
      - selenoid
    volumes:
      - ".:/etc/selenoid"
      - "./target:/output"
      - "/var/run/docker.sock:/var/run/docker.sock"
      - "./target:/opt/selenoid/video"
    environment:
      - "OVERRIDE_VIDEO_OUTPUT_DIR=$PWD/target"
    command: ["-limit", "10", "-conf", "/etc/selenoid/browsers.json", "-video-output-dir", "/opt/selenoid/video", "-container-network", "selenoid"]
  selenoid-ui:
    image: "aerokube/selenoid-ui:latest"
    container_name: selenoid-ui
    links:
      - selenoid
    ports:
      - "8083:8080"
    networks:
      - selenoid
    command: ["--selenoid-uri", "http://selenoid:4444"]
  chrome_79.0:
    image: "selenoid/vnc:chrome_79.0"
    container_name: chrome_79.0
    links:
      - selenoid
      - selenoid-ui
    depends_on:
      - selenoid
      - selenoid-ui
    networks:
      - selenoid
    volumes:
      - "/dev/shm:/dev/shm"
  sent:
    image: "sent:1.0"
    container_name: sent
    links:
      - selenoid
      - selenoid-ui
    depends_on:
      - selenoid
      - selenoid-ui
    networks:
      - selenoid
networks:
  selenoid:
    external:
      name: selenoid

send is a container that runs TestNG tests, but looks like can not find localhost URL.

If I check the open ports I see this

chrome_79.0   /entrypoint.sh                   Up                      4444/tcp              
selenoid      /usr/bin/selenoid -listen  ...   Up                      0.0.0.0:4444->4444/tcp
selenoid-ui   /selenoid-ui --selenoid-ur ...   Up (health: starting)   0.0.0.0:8083->8080/tcp

And I can access localhost:4444 from outside, but even the container is in the same network can not access localhost.

Any ideas?

Best answer