Created
October 25, 2022 18:40
-
-
Save colbyford/6f9d983247792623d73ac5c974298133 to your computer and use it in GitHub Desktop.
Example Dockerfile for running a Shiny app in a container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# FROM rocker/shiny-verse:latest | |
FROM rocker/shiny-verse:4.0.0 | |
## Install any Linux system dependencies | |
RUN apt-get update && apt-get install -y \ | |
sudo \ | |
libcurl4-gnutls-dev \ | |
libcairo2-dev \ | |
libxt-dev \ | |
libssl-dev | |
## Install R libraries | |
RUN R -e "install.packages(c('shiny', 'remotes', 'colourpicker', 'dplyr', 'ggplot2'))" | |
## Copy Shiny application files | |
COPY /app /srv/shiny-server/ | |
COPY /data /srv/shiny-server/data | |
## Grant access to server directory | |
RUN sudo chown -R shiny:shiny /srv/shiny-server | |
## Open the port for Shiny | |
EXPOSE 3838 | |
## Start Shiny Server | |
CMD ["R", "-e", "shiny::runApp('/srv/shiny-server/', host = '0.0.0.0', port = 3838)"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment