-
Notifications
You must be signed in to change notification settings - Fork 3
/
prod.Dockerfile
60 lines (49 loc) · 1.42 KB
/
prod.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
# Build stage
FROM rocker/shiny:4 AS builder
# Install system dependencies
RUN apt-get update && apt-get install --no-install-recommends -y \
libv8-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/ \
&& rm -rf /tmp/downloaded_packages/ /tmp/*.rds
# Install R packages
RUN install2.r --error --skipinstalled -n 4 \
remotes \
config \
data.table \
V8 \
shinyjs \
shiny.i18n \
sf \
logger \
dplyr \
reactable \
tidyr \
reactablefmtr \
purrr \
stringr \
deckgl \
htmlwidgets
RUN Rscript -e 'remotes::install_github(c( \
"dreamRs/d3.format@0a7656f36e4425c0da09802961cf95855b4b85e6" \
))'
RUN Rscript -e 'remotes::install_github("timelyportfolio/dataui")'
RUN Rscript -e 'remotes::install_version("apexcharter", version = "0.4.2")'
# Final stage
FROM rocker/shiny:4
# Copy installed R packages from builder
COPY --from=builder /usr/local/lib/R /usr/local/lib/R
# Copy application files
COPY inst /srv/shiny-server/inst
COPY R /srv/shiny-server/R
COPY DESCRIPTION /srv/shiny-server/DESCRIPTION
COPY NAMESPACE /srv/shiny-server/NAMESPACE
COPY data /srv/shiny-server/data
COPY app.R /srv/shiny-server/app.R
# Install the local package
RUN Rscript -e 'remotes::install_local("/srv/shiny-server", dependencies = FALSE)'
# Copy Shiny server configuration
COPY shiny.config /etc/shiny-server/shiny-server.conf
EXPOSE 8080
USER shiny
CMD ["/usr/bin/shiny-server"]