Commit 6f52d6f3 authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

Updated the Dockerfile to reduce size.

parent 2481a4c0
FROM rocker/shiny
ARG R_TAG=3.5.2
FROM rocker/shiny:$R_TAG AS builder
# Install and build R packages from CRAN and BioConduit, removing documentation and tests
RUN R -e 'install.packages( \
c("BiocManager", "DT", "dplyr", "factoextra", "glue", "microbenchmark", "shinycustomloader", "shinydashboard"), \
Ncpus='$(nproc)', \
clean=1, \
verbose=1 \
)' \
&& rm /usr/local/lib/R/*/*/{doc,html,help,unitTests}
RUN R -e 'BiocManager::install("phyloseq", Ncpus='$(nproc)', clean=1)' \
&& rm /usr/local/lib/R/*/*/{doc,html,help,unitTests}
&& R -e 'BiocManager::install("phyloseq", Ncpus='$(nproc)', clean=1)' \
&& rm -rf /usr/local/lib/R/*/*/{doc,html,help,unitTests}
# Use Yelp/dumb-init as entrypoint to properly handle Unix signals
RUN wget -O /sbin/dumb-init${DUMB_INIT_VERSION}/dumb-init_${DUMB_INIT_VERSION}_amd64 \
&& chmod +x /sbin/dumb-init
ADD${DUMB_INIT_VERSION}/dumb-init_${DUMB_INIT_VERSION}_amd64 /sbin/dumb-init
RUN chmod +x /sbin/dumb-init
ENTRYPOINT ["/sbin/dumb-init", "--"]
# Start the shiny server by default
CMD ["/usr/bin/"]
# Clear /srv/shiny-server/ and create /var/lib/shiny-server
RUN rm -rf /srv/shiny-server/* \
&& mkdir -p /srv/shiny-server/easy16s /var/lib/shiny-server
&& mkdir -p var/lib/shiny-server
# Install easy16S sources and resource
ADD *.R /srv/shiny-server/
ADD www /srv/shiny-server/www
ADD *.R /srv/shiny-server/easy16s/
ADD demo/demo.RData demo/chaillou.* /srv/shiny-server/easy16s/demo/
ADD www /srv/shiny-server/easy16s/www
# Build demo data
ADD demo /tmp/demo
RUN cd /tmp/demo \
&& R -f make-demo.R \
&& mkdir -p /srv/shiny-server/demo \
&& ls -la && cp demo.RData /srv/shiny-server/demo
# Fix file permissions
RUN chmod -R a+rX /srv/shiny-server/ \
&& chgrp shiny /var/lib/shiny-server \
&& chmod g+rwxs /var/lib/shiny-server
# Run with a non-privileged user
USER shiny
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