R/copy_app_instructions.R

Defines functions copy_app_instructions

copy_app_instructions <- function(folderpath='.',buildFolder=NULL){
  if(is.null(buildFolder)){
    stop('buildFolder must be specified')
  }

  if(folderpath=='.'){
    folderpath <- getwd()
  }
  foldername <- return_last(strsplit(folderpath,'/|\\\\')[[1]])

  file.copy(folderpath,buildFolder,recursive=TRUE)
  instructions <- sprintf('COPY ["%s", "/srv/shiny-server/"]\nCOPY shiny-server.conf  /etc/shiny-server/shiny-server.conf\nEXPOSE 80\nCOPY shiny-server.sh /usr/bin/shiny-server.sh\nRUN chown -R shiny:shiny /srv/shiny-server\nCMD ["/usr/bin/shiny-server.sh"]',foldername)
}
statisticiansix/dockerise documentation built on Nov. 5, 2019, 9:20 a.m.