Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #70 from HJMcSorley/master
Browse files Browse the repository at this point in the history
app fork to master
  • Loading branch information
HJMcSorley authored Apr 7, 2020
2 parents dac7c87 + cb3056f commit e1944cf
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 2 deletions.
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM plotly/heroku-docker-r:3.6.2_heroku18

# on build, copy application files
COPY . /app/

# for installing additional dependencies etc.
RUN if [ -f '/app/onbuild' ]; then bash /app/onbuild; fi;

# look for /app/apt-packages and if it exists, install the packages contained
RUN if [ -f '/app/apt-packages' ]; then apt-get update -q && cat apt-packages | xargs apt-get -qy install && rm -rf /var/lib/apt/lists/*; fi;

# look for /app/init.R and if it exists, execute it
RUN if [ -f '/app/init.R' ]; then /usr/bin/R --no-init-file --no-save --quiet --slave -f /app/init.R; fi;

# here app.R needs to match the name of the file which contains your app
CMD cd /app && /usr/bin/R --no-save -f /app/app.R
4 changes: 2 additions & 2 deletions app.R
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ app$callback(
})

# Run app
app$run_server(debug = TRUE)
app$run_server(host = "0.0.0.0", port = Sys.getenv('PORT', 8050))

# command to add dash app in Rstudio viewer:
# rstudioapi::viewer("http://127.0.0.1:8050")
# rstudioapi::viewer("http://127.0.0.1:8050")
9 changes: 9 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "Testing deployment of DashR app to heroku",
"description": "This app shows 1994 census data, in a 2020 kind of way.",
"keywords": [
"heroku",
"R deployment",
"Dash R"
],
}
3 changes: 3 additions & 0 deletions apt-packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
libcurl4-openssl-dev
libxml2-dev
libv8-3.14-dev
3 changes: 3 additions & 0 deletions heroku.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build:
docker:
web: Dockerfile
23 changes: 23 additions & 0 deletions init.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# R script to run author supplied code, typically used to install additional R packages
# contains placeholders which are inserted by the compile script
# NOTE: this script is executed in the chroot context; check paths!

r <- getOption('repos')
r['CRAN'] <- 'http://cloud.r-project.org'
options(repos=r)

# ======================================================================

# packages go here
install.packages('remotes')

remotes::install_github('plotly/dashR', upgrade=TRUE)
install.packages('dashCoreComponents')
install.packages('dashHtmlComponents')
install.packages('dashTable')
install.packages('here')
install.packages('tidyverse')
install.packages('glue')
install.packages('ggpubr')
install.packages('scales')
install.packages('plotly')

0 comments on commit e1944cf

Please sign in to comment.