Shiny Server for Docker
This is a Dockerfile for Shiny Server on Ubuntu Trusty. Some R packages needed by researchers of Rio de Janeiro Botanical Garden are installed.
The image is available in Docker Hub
Serving the sample apps that comes with Shiny Server
To run a container with Shiny Server in background (The container will not be removed after it exits. Do it manually.):
docker run -d -p 3838:3838 gmgall/shiny-server
To run a container with Shiny Server that will be removed when it exits:
docker run --rm -p 3838:3838 gmgall/shiny-server
localhost:3838/sample-apps/ from a browser to use one of the sample Shiny apps.
Serving an arbitrary Shiny app
To run an arbitrary Shiny app that are in a directory in the host, bind the host directory that contains the app with the
/srv/shiny-server/ directory in the container:
docker run -p 3838:3838 -v ~/Downloads/model/:/srv/shiny-server/ --rm gmgall/shiny-server
In the example above the Shiny app in host directory
~/Downloads/model/ will be served by the container through 3838 port.
If you need to monitor the app log file, bind the host directory that you want to receive the log with the
/var/log/shiny-server/ directory in the container:
docker run -p 3838:3838 -v ~/Downloads/model/:/srv/shiny-server/ -v /tmp/logs/:/var/log/shiny-server/ --rm gmgall/shiny-server
In the example above the app log will be written in the
/tmp/logs host directory.
The owner of the file will be the
shiny user (UID 999).
- Based on Ubuntu Trusty (14.04 LTS)
- Uses the R provided by the
r-basepackage from the Fiocruz CRAN repository
- Installs the following R packages from http://cran.rstudio.com:
- Installs the leaflet package from their git repository
- Installs Oracle Java 8 from the Webupd8 repository