Accessing shiny app via docker image on exposed port


I am in the process of creating an image of my shinyapp via docker. I have created the dockerfile and it runs. The final portion of the script is the below. As you can see we expose the port and then we use the simple runApp command to get it to run.


RUN Rscript -e "shiny::runApp(host = '', port = 3838, launch.browser = FALSE)"

In terms of the docker, I can see that is listening on the port and it is "running". You can see below is also referencing the correct port.

 => [14/14] RUN Rscript -e "shiny::runApp(host = '', port = 3838, launch.browser = FALSE)"                                                                         322.1s
 => => # Loading required package: shiny
 => => # Loading required package: methods
 => => # Listening on

Upon trying to access the app via http://localhost:3838/ or doesn't lead to being able to access the app. I am having the same problems as described here: When running docker container with Shiny app, cannot access at 3838. I am building the image via vscode IDE. I don't know what I am misisng.

It finally worked specifying it as such and changing the order. This was rather silly.

CMD ["R", "-e", "shiny::runApp(host='', port=3838)"]

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.