title: How to find shiny-server executable and reference it in shiny-server.sh?
body: <p>My docker image build seems to have went well, however, I am having issue with shiny-server executable. Mainly, the shiny-server executable is referenced as following in shiny-server.sh : </p>
  
  <pre><code>#!/bin/sh
  
  # Make sure the directory for individual app logs exists
    mkdir -p /var/log/shiny-server 
  chown shiny.shiny /var/log/shiny-server
  
  exec shiny-server &gt;&gt; /var/log/shiny-server.log 2&gt;&amp;1
  </code></pre>
  
  <p>The above code doesn't work for me (don't know why), so I had to change it to this way:</p>
  
  <pre><code>#!/bin/bash
  
  # Make sure the directory for individual app logs exists
  mkdir -p /var/log/shiny-server
  chown shiny.shiny /var/log/shiny-server
  
  if [ "$APPLICATION_LOGS_TO_STDOUT" = "false" ];
  then
      exec shiny-server 2&gt;&amp;1
  else
      # start shiny server in detached mode
      exec shiny-server 2&gt;&amp;1 &amp;
  
      # push the "real" application logs to stdout with xtail
      exec xtail /var/log/shiny-server/
  fi
  </code></pre>
  
  <p>However, I get the following errors:</p>
  
  <pre><code>$ docker run -p 80:8080 fitfarmz3
  
  *** warning - no files are being watched ***
  /usr/bin/shiny-server.sh: line 12: shiny-server: No such file or directory
  </code></pre>
  
  <p>Would appreciate how to resolve this.</p>
  
  <p>Here I include the dockerfile:</p>
  
  <pre><code>FROM r-base:3.5.0
  
  # Install Ubuntu packages
  RUN apt-get update &amp;&amp; apt-get install -y \
      sudo \
      gdebi-core \
      pandoc \
      pandoc-citeproc \
      libcurl4-gnutls-dev \
      libcairo2-dev/unstable \
      libxt-dev \
      libssl-dev 
  
  
  # Add shiny user
  RUN groupadd  shiny \
  &amp;&amp; useradd --gid shiny --shell /bin/bash --create-home shiny
  
  
  
  # Download and install ShinyServer
  RUN wget --no-verbose https://download3.rstudio.org/ubuntu-14.04/x86_64/shiny-server-1.5.7.907-amd64.deb &amp;&amp; \
      gdebi shiny-server-1.5.7.907-amd64.deb
  
  
  # Install R packages that are required
  RUN R -e "install.packages(c('Benchmarking', 'plotly', 'DT'), repos='http://cran.rstudio.com/')"
  RUN R -e "install.packages('shiny', repos='https://cloud.r-project.org/')"
  
  # Copy configuration files into the Docker image
  COPY shiny-server.conf  /etc/shiny-server/shiny-server.conf
  COPY /app /srv/shiny-server/
  
  # Make the ShinyApp available at port 80
  EXPOSE 80
  
  # Copy further configuration files into the Docker image
  COPY shiny-server.sh /usr/bin/shiny-server.sh
  
  CMD ["/usr/bin/shiny-server.sh"]
  </code></pre>