Shiny Report Dashboard for ShinyProxy

So, as it currently stands, once a user has logged into the ShinyProxy report dashboard if there are dozens of report choices it is far from an optimal layout. That is not to unfairly criticize your work - please don’t be offended! - it could just be prettier and better organized.

It occurred to me though that in the spirit of ShinyProxy a very nice and 100% customizable solution would be if a user could launch a ‘ShinyProxy Reporting Dashboard’ Shiny app. That is, it is possible to launch other docker containers from within a docker container. So, a Shiny app could be made that is a beautiful interface to all the other Shiny apps one wants to deploy through ShinyProxy.

So, would this be possible to do through ShinyProxy either now or in the future? Here is a more explicit version of what I am thinking of:

Dockerfile - note that your local docker engine may have to be upgraded if it is not docker-engine=1.12.3-0~xenial

FROM openanalytics/r-base

MAINTAINER Brian Muchmore “brian.muchmore@genyo.es”

RUN apt-get update && apt-get install -y
sudo
pandoc
pandoc-citeproc
libcurl4-gnutls-dev
libcairo2-dev
libxt-dev
libssl-dev
libssh2-1-dev
libssl1.0.0

RUN R -e “install.packages(c(‘shiny’, ‘rmarkdown’, ‘shinydashboard’), repos=‘https://cloud.r-project.org/’)”

RUN apt-get update &&
apt-get install -y apt-transport-https
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D &&
echo “deb https://apt.dockerproject.org/repo ubuntu-xenial main” > /etc/apt/sources.list.d/docker.list &&
apt-get update &&
apt-get install -y docker-engine=1.12.3-0~xenial \
socat &&
apt-get clean &&
rm -rf /var/lib/apt-lists/*

RUN mkdir /root/ReportingDashboard
COPY ReportingDashboard /root/ReportingDashboard

COPY Rprofile.site /usr/lib/R/etc/

EXPOSE 3838

CMD [“R”, “-e shiny::runApp(’/root/ReportingDashboard’)”]

ui.R

library(shiny)
library(shinydashboard)
dashboardPage(
dashboardHeader(title = “Example Reporting”),
dashboardSidebar(
sidebarMenu(
menuItem(“Dashboard”, tabName = “dashboard”)
)
),
dashboardBody(
tabItems(
tabItem(“dashboard”,
fluidRow(
box(
actionButton(“launchButton”, “Launch Report”),
p(“Click to launch docker images command, which should return a list of all local images.”)
),
box(
textOutput(“launchText”)
)
)
)
)
)
)

server.R - Note that depending on the system, system(‘docker images’, intern = TRUE) may have to be system(‘sudo docker images’, intern = TRUE)

library(shiny)
shinyServer(function(input, output) {
launchText_input <- eventReactive(input$launchButton, {
system(‘docker images’, intern = TRUE)
})

output$launchText <- renderPrint({
launchText_input()
})
})

It is not possible (at least, not that I am aware of) to mount a host volume in a dockerfile, thus this is how I tested

docker run -v /var/run/docker.sock:/var/run/docker.sock -p 3838:3838 bmuchmore/reportingdashboardshinyproxy

I’ve thought similarly, but an easier solution might be to have a configurable landing page. E.g. in the application.yml have a few template options that someone can switch between.

shiny:
  proxy:
    template: standard #options 'thumbnail', '4 col'

E.g. ‘standard’ for what we currently have.
‘thumbnail’ for a thumbnail bootstrap template
’4 col’ for a 4 column template etc