How to get the port numbers for a service – Docker compose file

I am trying to start containers with the docker-compose.yml. I am trying to start two services, one is mongo and other is OHIF viewer.

Currently I am able to access mongo locally (localhost:27017(after port-forwarding) in desktop whereas OHIF viewer isn’t possible (ports aren’t visible/empty so, I am not able to access them locally). Can you guide me as to how I can set them?

enter image description here

As you can see from my docker-compose file that I have set network_mode:”host” to be able to access them locally in my desktop as well.

Based on my json file, I thought the port was already set (pacsIP:8042) but it’s missing as shown in screenshot above when I execute “docker ps” command. Can you guide me on this? I am new to docker and your inputs will definitely be helpful. PACSIP is my docker host (remote linux server) IP. I would like to port forward them and view it in my desktop

Please find below the docker-compose.yml file

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

     image: ohif/viewer:latest
      container_name: ohif-viewer
        - "3030:80"
        - "8042:8042" - # Not sure whether this is correct. I tried with and without this as well but it didn't work
      network_mode: "host"   
         - MONGO_URL=mongodb://mongo:27017/ohif
          - ""
         - ./dockersupport-app.json:/app/app.json

As you can see that in the volumes, I am using a dockersupport-app.json file which is given below

   "apps" : [{
   "name"        : "ohif-viewer",
    "script"      : "main.js",
    "watch"       : true,
    "merge_logs"  : true,
    "cwd"         : "/app/bundle/",
    "env": {
              "servers": {
                "dicomWeb": [
                    "name": "Orthanc",
                    "wadoUriRoot": "http://pacsIP:8042/wado", # these ports 
                    "qidoRoot": "http://pacsIP:8042/dicom-web", #these ports
                    "wadoRoot": "http://pacsIP:8042/dicom-web", #these ports
                    "qidoSupportsIncludeField": false,
                    "imageRendering": "wadouri",
                    "thumbnailRendering": "wadouri",
                    "requestOptions": {
                      "auth": "orthanc:orthanc",
                      "logRequests": true,
                      "logResponses": false,

How can I access the OHIF-Viewer locally? What changes should I make to docker-compose.yml or json file? I did with and without port 8042 under “Ports” section of docker-compose file but it didn’t work still.

Source: StackOverflow