From 34495a937ba6af2c821b9e2ae19e7639c5c548ed Mon Sep 17 00:00:00 2001 From: DavidSpek Date: Mon, 26 Oct 2020 16:56:58 +0100 Subject: [PATCH 1/2] Automate the previously needed manual startup steps Rather than needing to go into the container shell and executing the R script and Payara application server, the container can now be started with `docker run -d -p 8080:8080 metab_docker` and directly accessed through the webui at http://localhost:8080/MetaboAnalyst/. Remove the `-d` if you would like to see the shell output. --- Dockerfile | 7 +++++-- run.sh | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 run.sh diff --git a/Dockerfile b/Dockerfile index c54188c..a464217 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,7 +50,7 @@ RUN apt-get update && \ littler \ r-base \ r-base-dev \ - r-recommended && \ + r-recommended && \ ln -s /usr/lib/R/site-library/littler/examples/install.r /usr/local/bin/install.r && \ ln -s /usr/lib/R/site-library/littler/examples/install2.r /usr/local/bin/install2.r && \ install.r docopt && \ @@ -75,6 +75,8 @@ RUN R -e 'BiocManager::install(c("impute", "pcaMethods", "siggenes", "globaltest ADD rserve.conf /rserve.conf ADD metab4script.R /metab4script.R +ADD run.sh /run.sh +RUN chmod +x /run.sh # Download and Install Payara Micro # From payara/micro github - https://github.com/payara/docker-payaramicro/blob/master/Dockerfile @@ -106,4 +108,5 @@ ENV METABOANALYST_FILE_NAME MetaboAnalyst.war RUN wget --quiet -O $DEPLOY_DIR/$METABOANALYST_FILE_NAME $METABOANALYST_LINK -ENTRYPOINT ["bin/bash"] +ENTRYPOINT ["java", "-XX:+UseContainerSupport", "-XX:MaxRAMPercentage=90.0", "-jar", "/opt/payara/payara-micro.jar"] +CMD ["/run.sh", "--deploymentDir", "/opt/payara/deployments"] \ No newline at end of file diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..35394a8 --- /dev/null +++ b/run.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +Rscript /metab4script.R > /dev/null 2>&1 \ No newline at end of file From 2f98e5efbe4c2bb331d040aa6b72df7648c6c686 Mon Sep 17 00:00:00 2001 From: DavidSpek Date: Mon, 26 Oct 2020 22:41:53 +0100 Subject: [PATCH 2/2] Fix wrong rserve.conf dir --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a464217..a64df2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,7 +73,7 @@ RUN install2.r RColorBrewer xtable fitdistrplus som ROCR RJSONIO gplots e1071 ca # Install all R packages from Bioconductor RUN R -e 'BiocManager::install(c("impute", "pcaMethods", "siggenes", "globaltest", "GlobalAncova", "Rgraphviz", "KEGGgraph", "preprocessCore", "genefilter", "SSPA", "sva", "limma", "mzID", "xcms"))' -ADD rserve.conf /rserve.conf +ADD rserve.conf /etc/rserve.conf ADD metab4script.R /metab4script.R ADD run.sh /run.sh RUN chmod +x /run.sh @@ -109,4 +109,4 @@ ENV METABOANALYST_FILE_NAME MetaboAnalyst.war RUN wget --quiet -O $DEPLOY_DIR/$METABOANALYST_FILE_NAME $METABOANALYST_LINK ENTRYPOINT ["java", "-XX:+UseContainerSupport", "-XX:MaxRAMPercentage=90.0", "-jar", "/opt/payara/payara-micro.jar"] -CMD ["/run.sh", "--deploymentDir", "/opt/payara/deployments"] \ No newline at end of file +CMD ["/run.sh", "--deploymentDir", "/opt/payara/deployments"]