1
votes

I am using Windows 10 Pro with Docker installed. I $ docker pull rocker/shiny image on my computer and started it as described in documentation https://hub.docker.com/r/rocker/shiny/ using the following command:

docker run -d -p 80:3838 -v C:\\Users\\<My name>\\Documents\\R\\Rprojects\\ShinyHelloWorld\\:/srv/shiny-server/ -v C:\\Users\\<My name>\\Documents\\R\\Rprojects\\ShinyHelloWorld\\:/var/log/shiny-server/ rocker/shiny

The container created successfully:

docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                  NAMES
f0ee402966b9        rocker/shiny        "/usr/bin/shiny-serv…"   2 minutes ago       Up 2 minutes        0.0.0.0:80->3838/tcp   youthful_banach

I created ShinyHelloWorld application using RStudio, and the folder on the local host that I mounted to docker container basically contains one file app.R with default shiny application created by RStudio.

Now the problem is: I can't run this application from my browser using address http://localhost:3838/ShinyHelloWorld/.

When I use URL http://localhost:3838 it returns web page with single sentence Index of /. So, there is some one who listens.

Did I correctly run shiny server?

I suppose that I am using incorrect URL in my browser to access server. How to do it correctly?

Do I need some installation of my shiny app to the server?

Is it possible to run shiny server using tocken, like with: http://localhost:8888/?token=44dab68c1bc7b1662041853573f37cfa03f13d029d397816 as described, e.g. in the book for COOK, J.: Docker for Data Science: Building Scalable and Extensible Data Infrastructure Around the Jupyter Notebook Server: Apress., 2017

How to find the tocken if it exists?

Suppose that I want to use docker-compose.yml and then $ docker-compose up. Please, help complete the script below to execute the same command as above.

    version:                "3"
    services:
          image:            rocker/shiny
          volumes:
            - C:\\Users\\aabor\\Documents\\R\\Rprojects\\ShinyHelloWorld:/srv/shiny-server/
            - C:\\Users\\aabor\\Documents\\R\\Rprojects\\ShinyHelloWorld:/var/log/shiny-server/
          ports:
            - 80:3838
          container_name:   rocker-shiny-container
2
On Windows with boot2docker you need to visit 192.168.59.103:3838 see usageGyD
I do not use boot2docker it is not necessary in this particular case.Alexander

2 Answers

1
votes

Look at ports 0.0.0.0:80->3838/tcp - means your port 80 will go to 3838 on the container - so you should try http://localhost first.

0
votes

I resolved the issue by myself. The problem was with folder path.

This command will create docker container correctly:

docker run -d -p 3838:3838 -v //c/Users/<My Name>/Documents/R/Rprojects:/srv/shiny-server/ -v //c/Users/<My Name>/Documents/R/Rprojects:/var/log/shiny-server/ rocker/shiny

Then if I use URL http://localhost:3838/ShinyHelloWorld/ in my browser shiny application will start.