-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
32 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,37 @@ | ||
# create a Docker image for the shiny app | ||
FROM rocker/shiny:latest | ||
|
||
# install R packages | ||
RUN R -e "install.packages('DT')" | ||
RUN R -e "install.packages('tidyverse')" | ||
RUN R -e "install.packages('plotly')" | ||
RUN R -e "install.packages('shinythemes')" | ||
RUN R -e "install.packages('shinydashboard')" | ||
RUN R -e "install.packages('shinyjs')" | ||
RUN R -e "install.packages('shinyBS')" | ||
RUN R -e "install.packages('shinyWidgets')" | ||
RUN R -e "install.packages('shinydashboardPlus')" | ||
|
||
# copy the app to the image | ||
RUN mkdir /root/shiny | ||
FROM rocker/shiny:3.6.3 | ||
|
||
# install R packages required for the app | ||
# chain the RUN commands to reduce the number of layers | ||
RUN R -e "install.packages('tidyverse', repos='http://cran.us.r-project.org')" | ||
RUN R -e "install.packages('DT', repos='http://cran.us.r-project.org')" | ||
RUN R -e "install.packages('shiny', repos='http://cran.us.r-project.org')" | ||
RUN R -e "install.packages('shinydashboard', repos='http://cran.us.r-project.org')" | ||
RUN R -e "install.packages('shinythemes', repos='http://cran.us.r-project.org')" | ||
RUN R -e "install.packages('shinyjs', repos='http://cran.us.r-project.org')" | ||
RUN R -e "install.packages('shinyBS', repos='http://cran.us.r-project.org')" | ||
RUN R -e "install.packages('shinyWidgets', repos='http://cran.us.r-project.org')" | ||
RUN R -e "install.packages('shinydashboardPlus', repos='http://cran.us.r-project.org')" | ||
RUN R -e "install.packages('plotly', repos='http://cran.us.r-project.org')" | ||
|
||
# Set working directory | ||
WORKDIR /root/shiny | ||
|
||
# copy contents of app into container and create data directory | ||
# make a volume in the data directory | ||
COPY . /root/shiny/ | ||
|
||
# create data directory | ||
RUN mkdir data | ||
|
||
# copy CSVs into data | ||
COPY *.csv data/ | ||
|
||
# create volume in data directory | ||
VOLUME [ "data/" ] | ||
|
||
# select port | ||
EXPOSE 3838 | ||
|
||
# run app | ||
CMD ["R", "-e", "shiny::runApp('/root/shiny')"] | ||
|
||
CMD ["R", "-e", "shiny::runApp('/root/shiny', port=3838, host='0.0.0.0')"] |
This file contains 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