-
Notifications
You must be signed in to change notification settings - Fork 2
/
front_end.Dockerfile
60 lines (45 loc) · 1.29 KB
/
front_end.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
FROM rocker/shiny-verse:3.6.1 as base1
MAINTAINER Daniel Loos "[email protected]"
# system update
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
vim \
apt-utils \
libmagick++-dev \
sshpass && \
apt-get clean
WORKDIR /app
RUN mkdir userdat && chmod a+rwx userdat
# Expose shiny port
EXPOSE 3838
COPY front_end/install.R ./
FROM base1 as base2
RUN Rscript ./install.R
# install danielLib
COPY danielLib/ ./danielLib
RUN export R_REMOTES_NO_ERRORS_FROM_WARNINGS="true" && \
R -e "devtools::install('/app/danielLib/')"
COPY front_end/index.html /srv/shiny-server/
#
# Production stage
#
FROM base2 as production
RUN R -e "install.packages('profvis')"
COPY front_end /srv/shiny-server/latest
RUN mv /srv/shiny-server/latest/index.html /srv/shiny-server/index.html
# parse env vars to shiny apps and start shiny server
CMD env > /home/shiny/.Renviron && \
chown shiny.shiny /home/shiny/.Renviron && \
runuser -l shiny -c '/usr/bin/shiny-server.sh'
#
# Development stage
#
FROM base2 as dev
RUN R -e "install.packages('profvis')"
# parse env vars to shiny apps and start shiny server
CMD env > /home/shiny/.Renviron && \
chown shiny:shiny -R /userdat && \
chown shiny.shiny /home/shiny/.Renviron && \
ls -R /app && \
runuser -l shiny -c '/usr/bin/shiny-server.sh'