lynx:Unable to connect to remote host - Issue with Docker-compose?

2.3k Views Asked by At

I am trying to start the below two services mongo and OHIF-Viewer as mentioned below in the docker-compose file

version: '3.6'
services:
    mongo:
  image: "mongo:latest"
  container_name: ohif-mongo
  ports:
    - "27017:27017"

  viewer:
 image: ohif/viewer:latest
 container_name: ohif-viewer
 ports:
  - "3030:80"
  - "3031:443"
 network_mode: "host"
 environment:
  - MONGO_URL=mongodb://mongo:27017/ohif
 extra_hosts:
  - "pacsIP:172.xx.xxx.xxx"
 volumes:
  - ./dockersupport-app.json:/app/app.json

As shown in the above docker file, I have two services. And when I do lynx localhost:27017, I am able to see that it returns valid result. whereas when I do lynx localhost:3030 or lynx localhost:3031, I get the below error message as

Looking up localhost first
Looking up localhost:3031
Making HTTP connection to localhost:3031
Alert!: Unable to connect to remote host.

lynx: Can't access startfile http://localhost:3031/

Please note that based on some SO forum responses, I have already set export WWW_HOME="http://www.google.com/" before issuing lynx command as well.

When I run the docker-compose file, the command executued successfully but I am not able to connect to lynx localhost:3031 or lynx localhost:30. How can I connect to these two ports?

0

There are 0 best solutions below