-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
63 lines (52 loc) · 2.47 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
FROM quay.io/fedora/s2i-base:40
LABEL maintainer="ISU Research IT <[email protected]>"
ENV \
SHINYSRVPKG=shiny-server-1.5.22.1017-x86_64.rpm \
STI_SCRIPTS_URL=image:///usr/libexec/s2i \
STI_SCRIPTS_PATH=/usr/libexec/s2i \
APP_ROOT=/opt/app-root \
HOME=/opt/app-root/ \
PATH=/opt/app-root/:/opt/spack/bin:$PATH
# package installation
RUN \
dnf -y update && \
dnf -y install \
R libxml2-devel libcurl-devel openssl-devel v8-devel fribidi-devel \
nss_wrapper mariadb-devel udunits2-devel geos-devel gdal-devel \
proj-devel cairo-devel jq-devel protobuf-devel protobuf-compiler \
sqlite-devel wget geos gdal git file libXt-devel harfbuzz-devel \
freetype-devel libpng-devel libtiff-devel libjpeg-turbo-devel && \
dnf clean all;
# configure R
RUN \
echo -e '\noptions(repos = c(CRAN="https://mirror.las.iastate.edu/CRAN"))' >> /usr/lib64/R/library/base/R/Rprofile && \
mkdir -p /opt/app-root/src/R_libs /opt/app-root/.R && \
chmod -R g+w /opt/app-root/src && \
echo "R_LIBS=/opt/app-root/src/R_libs" > /opt/app-root/.Renviron && \
echo "MAKEFLAGS = -j3" > /opt/app-root/.R/Makevars;
# install and configure shiny server
RUN \
Rscript -e "install.packages(c('shiny','devtools','stringr','BiocManager'))" && \
Rscript -e "install.packages(c('shinythemes','dplyr','ggplot2','leaflet'))" && \
Rscript -e "install.packages(c('lubridate','raster','spData','geojsonio'))" && \
Rscript -e "install.packages(c('sf','plotly','tidyr','wesanderson'))" && \
wget https://download3.rstudio.org/centos7/x86_64/$SHINYSRVPKG && \
dnf -y --nogpgcheck install $SHINYSRVPKG && \
dnf clean all && \
rm -f $SHINYSRVPKG && \
chmod -R o+w /var/log/shiny-server && \
chmod g+w /var/lib/shiny-server && \
sed -i -e 's|/srv/shiny-server|/opt/app-root/src|g' /etc/shiny-server/shiny-server.conf && \
sed -i -e 's/run_as shiny;/run_as openshift;/g' /etc/shiny-server/shiny-server.conf && \
echo "app_init_timeout 300;" >> /etc/shiny-server/shiny-server.conf && \
echo "app_idle_timeout 300;" >> /etc/shiny-server/shiny-server.conf;
# Copy in installdeps.R to set cran mirror & handle package installs
COPY ./installdeps.R /opt/app-root/src
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH
COPY ./s2i/bin/ $STI_SCRIPTS_PATH
# Copy the passwd template for nss_wrapper
COPY passwd.template /tmp/passwd.template
USER 1001
EXPOSE 3838
STOPSIGNAL SIGTERM
CMD ["/usr/libexec/s2i/run"]