Background
I'm using another docker image and installing Shiny Server via commands in the dockerfile. The images are in a subdirectory named "www" in the app.R directory. Below is my shiny app structure:
library(shiny)
library(shinythemes)
setwd("/srv/shiny-server/")
myFile = readRDS("MyFile.RDS")
# # Define UI
ui <- fluidPage(theme = shinytheme("readable"),
navbarPage(
title = div(img(src='logo.png',
style="margin-top: -14px;
padding-right:10px;
padding-bottom:10px",
height = 60)),
windowTitle="Sample Shiny App",
tabPanel("Tab 1", "Sample body text")
) # navbar page
) # fluid page
server <- function(input, output, session) {
# Some server code
}
shinyApp(ui = ui, server = server)
And my DockerFile is as follows:
FROM facebook/robyn
ENV TEST_ENV=""
# Shiny server app
COPY /. /srv/shiny-server/
# Install libraries
RUN Rscript /srv/shiny-server/install_packages.R
# Install Shiny Server
RUN sudo apt-get update && \
sudo apt install -y gdebi-core && \
wget https://download3.rstudio.org/ubuntu-14.04/x86_64/shiny-server-1.5.17.973-amd64.deb && \
sudo gdebi shiny-server-1.5.17.973-amd64.deb
EXPOSE 3838
CMD Rscript /srv/shiny-server/app.R
Problem:
The shiny app runs, it even reads the RDS file in the app directory. The only problem is that the logo.png doesn't render the way it used to do on my local simple Shiny through RStudio.
Attempts:
I've tried using different image paths, for example www/logo.png
, /srv/shiny-server/www/logo.png
, but the outcome is the same that the image doesn't render.
Question:
What can I do to get my logo image to render my logo in the Shiny Server?