Commit 603830b6 authored by Jean-Karim Heriche's avatar Jean-Karim Heriche

Added Dockerfile.

parent 82b717ff
# Install R 3.6.3
FROM r-base:3.6.3
RUN apt-get update && apt-get install -y libssl-dev liblzma-dev libbz2-dev libicu-dev libtiff-dev libfftw3-dev libcurl4-openssl-dev libxml2-dev libssh2-1-dev libgit2-dev
# Install Java for use with the rJava package
RUN apt-get install -y openjdk-8-jdk
# Install required R packages
RUN R CMD javareconf
RUN R -e "install.packages('rJava', repos='https://ftp.gwdg.de/pub/misc/cran/')"
RUN R -e "install.packages('remotes', repos='https://ftp.gwdg.de/pub/misc/cran/')"
RUN R -e "install.packages('rversions', repos='https://ftp.gwdg.de/pub/misc/cran/')"
RUN R -e "install.packages('roxygen2', repos='https://ftp.gwdg.de/pub/misc/cran/')"
RUN R -e "install.packages('xml2', repos='https://ftp.gwdg.de/pub/misc/cran/')"
RUN R -e "install.packages('devtools', repos='https://ftp.gwdg.de/pub/misc/cran/')"
RUN R -e "library(devtools); install_github('jkh1/EBImage')"
RUN R -e "install.packages('DT', repos='https://ftp.gwdg.de/pub/misc/cran/')"
RUN R -e "install.packages('shiny', repos='https://ftp.gwdg.de/pub/misc/cran/')"
RUN R -e "install.packages('shinyFiles', repos='https://ftp.gwdg.de/pub/misc/cran/')"
RUN R -e "install.packages('shinycssloaders', repos='https://ftp.gwdg.de/pub/misc/cran/')"
RUN R -e "install.packages('shinydashboard', repos='https://ftp.gwdg.de/pub/misc/cran/')"
RUN R -e "install.packages('ggplot2', repos='https://ftp.gwdg.de/pub/misc/cran/')"
RUN R -e "install.packages('plotly', repos='https://ftp.gwdg.de/pub/misc/cran/')"
RUN R -e "install.packages('RANN', repos='https://ftp.gwdg.de/pub/misc/cran/')"
RUN R -e "install.packages('BiocManager', repos='https://ftp.gwdg.de/pub/misc/cran/')"
RUN R -e "BiocManager::install('aoles/RBioFormats')"
# Copy the app to the image
RUN mkdir -p /usr/local/app/image-data-explorer
COPY image_data_explorer.R /usr/local/app/image-data-explorer/
# IDE is available on port 5476
EXPOSE 5476
# Create user
RUN useradd -m ide -d /home/ide
# Set working directory
WORKDIR /home/ide
# Run as user ide to avoid running as root or require user to run
# with the --user flag
USER ide
# Run the app
CMD ["Rscript","/usr/local/app/image-data-explorer/image_data_explorer.R"]
......@@ -1006,13 +1006,13 @@ server <- function(input, output, session) {
})
## Stop the app when browser tab is closed
session$onSessionEnded(stopApp)
## Not used with Docker container
# session$onSessionEnded(stopApp)
}
## Run the application
shinyApp(ui = ui, server = server, options = list(port = 5476, host = "0.0.0.0"))
## Supply desired port to runApp() because it ignores options in shinyApp()
IDE <- shinyApp(ui = ui,
server = server,
enableBookmarking = "url")
runApp(IDE, port = 5476)
## Need to supply host for use in Docker container
runApp(IDE, port = 5476, host = "0.0.0.0")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment