我正在尝试在docker-compose文件中启动以下两个服务mongo和OHIF-Viewer
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
如上面的docker文件中所示,我有两项服务。当我执行lynx localhost:27017时,我可以看到它返回有效结果。而当我执行lynx localhost:3030或lynx localhost:3031时,我得到以下错误消息为
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/
请注意,根据一些SO论坛的响应,在发出lynx命令之前,我已经设置了export WWW_HOME = “ http://www.google.com/” 。
当我运行docker-compose文件时,命令成功执行,但是我无法连接到lynx localhost:3031或lynx localhost:30。如何连接这两个端口?