Skip to content
Browse files

Merge branch 'master' of…

  • Loading branch information
HendrikSchultheis committed Mar 21, 2019
2 parents abc62aa + 3b4f137 commit 8fec4e70331499f2e6452265a41ff8267ce4c1f8
Showing with 123 additions and 0 deletions.
  1. +82 −0 docker/1.5.4/Dockerfile
  2. +41 −0 docker/1.5.4/
@@ -0,0 +1,82 @@
# Pulls debian:latest from dockerhub
FROM debian

# Dockerfile questions go to
MAINTAINER C. Kuenne / MPI-BN / Bioinformatics /

#Some basic packages, updates and cleanup
RUN apt-get -y update && apt-get -y upgrade && \
apt-get -y install \
r-base \
wget \
libnlopt-dev \
libssl-dev \
libxml2-dev \
libcurl4-openssl-dev \
git \
procps \
gdebi-core && \
apt-get clean

#Installs DEVTOOLS
RUN Rscript -e "install.packages(c('devtools'), repos='')"

#Installs BIOCONDUCTOR/BiocInstaller
RUN Rscript -e 'source("")'

#Install Shiny-Server
#RUN wget && \
#gdebi -n shiny-server- && \
#RUN wget && \
#gdebi -n shiny-server- && \
RUN wget && \
gdebi -n shiny-server- && \
rm /srv/shiny-server/index.html && \
rm -rf /srv/shiny-server/sample-apps

#install shinythemes
RUN Rscript -e 'install.packages("shinythemes", repos="")'

#install shinyBS
RUN Rscript -e 'install.packages("shinyBS", repos="")'

#install old mvtnorm package (1.0-8), because the current 1.0-10 needs r 3.5 (current debian r is 3.3)
RUN Rscript -e 'devtools::install_version(repos="", package = "mvtnorm", version = "1.0-8")'

#Install WILSON
RUN Rscript -e 'devtools::install_github(repo = "loosolab/wilson", host="", auth_token = NULL, upgrade = "never")'

#Install stackdump
#RUN Rscript -e 'devtools::install_github(repo = "jcheng5/stackdump")'

#Install WILSON App
#RUN git clone -b stackdump /srv/shiny-server/tmp && \
RUN git clone /srv/shiny-server/tmp && \
cp -a /srv/shiny-server/tmp/wilson-basic/. /srv/shiny-server/ && \
rm -rf /srv/shiny-server/tmp

#Install webshot/phantomjs to permit download of interactive plots with
RUN Rscript -e 'install.packages("webshot", repos="")'
RUN Rscript -e 'webshot::install_phantomjs()'
RUN cp /root/bin/phantomjs /usr/local/bin


RUN rm -rf /srv/shiny-server/data && \
mkdir /srv/shiny-server/data

#check current directory for the presence of clarion input files (*.se, *.clarion) -> include in container
#add pointless additional copy of because otherwise the building will fail if no clarion files exist (yuck!)
ADD *.se *.clarion /srv/shiny-server/data/
RUN rm /srv/shiny-server/data/

ADD /usr/bin/
RUN chmod +x /usr/bin/

#switch shiny user uid to 1000 (previously docker user); set permissions
RUN usermod -u 1000 shiny && \
chown -R shiny:shiny /srv/shiny-server/ && \
mkdir -p /srv/shiny-server/logs && \
chmod ugo+wrX /srv/shiny-server/logs

CMD ["/usr/bin/"]
@@ -0,0 +1,41 @@

#this script is run when the container is started
#optionally adds $CONTAINERKEY to shiny server url by modifying shiny-server.conf
#to use this add the "-e" parameter when starting a container:
#docker run ... -e CONTAINERKEY=${container_key} ...
#docker run --name='sav1' -d -p 50000:3838 -v '/mnt/agnerds/docker/projects/sav1':'/srv/shiny-server/data' -e CONTAINERKEY=sav1 loosolab/wilson:1.2"
#-> http://<IP>:50000/sav1


#create backup of original shiny-server.conf
if [[ ! -f "${conf}.old" ]]; then
cp ${conf} ${conf}.old
cp ${conf}.old ${conf}

#add parameter(s) at top of .conf
param="preserve_logs true;"
sed -i "1i $param" ${conf}

param="sanitize_errors off;"
sed -i "1i $param" ${conf}

#if environment variable given -> add key to url
if [[ ! -z "$CONTAINERKEY" ]]; then
CONTAINERKEY=$(echo -e $CONTAINERKEY | sed 's/\//\\\//g') #to escape "/"
cat ${conf} | sed "s/location \//location \/$CONTAINERKEY/g" >${conf}.1
mv ${conf}.1 ${conf}

#start shiny server
exec shiny-server 2>&1 >>/var/log/shiny-server.log

0 comments on commit 8fec4e7

Please sign in to comment.
You can’t perform that action at this time.