Skip to content

Commit

Permalink
Edit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shuyib committed Dec 28, 2022
1 parent 9cf8a4e commit 13bc3ef
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 19 deletions.
47 changes: 30 additions & 17 deletions shiny-time-series/Dockerfile
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')"]
4 changes: 2 additions & 2 deletions shiny-time-series/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ library(DT)
library(shinythemes)

# load data
df <- read_csv("../data/yt_date.csv")
df2 <- read_csv("../data/exotic_yt_date.csv")
df <- read_csv("data/yt_date.csv")
df2 <- read_csv("data/exotic_yt_date.csv")


# label the dataset for each channel
Expand Down

0 comments on commit 13bc3ef

Please sign in to comment.