The Docker Hub has a similar instance of Shiny-Server called Rocker, which runs on a Debian instance. However, many organizations prefer to run production servers on CentOS. This work uses CentOS 7. There is also a similar container based on CentOS 6.7, which was the inspiration for this container.
-
R
-
RStudio Server
-
Shiny-Server
- shiny, rmarkdown, devtools, RJDBC, dplyr, plotly, RPostgreSQL, lubridate, DT, forecast, ggplot2, DBI, magittr, stringr, shinyjs, and RPostgres
-
Install Docker on your system.
-
Download or clone this repository.
docker build /YOUR_PATH_TO/forecastr -t forecastR:1
docker images
docker run -p 3838:3838 -p 8787:8787 -d forecastr:1
-
Shiny-Server is running at localhost:3838
-
RStudio Server is running at localhost:8787
localhost:8787
- The username and password for RStudio Server is
rstudio
.
setwd("/home/rstudio/R")
library(shiny)
runApp(port = 3894, launch.browser = TRUE)
This is a bare-bones container, so there is a good chance you will want to do some additional configuration. The command below will start your Docker instance and dump you into the root shell.
docker run -p 3838:3838 -p 8787:8787 -it shiny-server /bin/bash
-
Arg -i tells docker to attach stdin to the container.
-
Arg -t tells docker to give us a pseudo-terminal.
-
Arg /bin/bash will run a terminal process in your container.
Maybe you need a PostgreSQL instance?
yum install postgresql-devel -y
exit
docker ps -a
The syntax is:
docker commit [CONTAINER ID] [REPOSITORY:TAG]
It should look something like this:
docker commit b59185b5ba4b docker-shiny:shiny-server-v2
docker images