-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
86 lines (77 loc) · 2.89 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# syntax = docker/dockerfile:1.0-experimental # https://docs.docker.com/develop/develop-images/build_enhancements/
FROM rocker/r-ver:4.3.0
RUN export DEBIAN_FRONTEND=noninteractive && apt-get -y update \
&& apt-get install -y \
libgdal-dev \
libudunits2-dev \
libxt6 \
xdg-utils \
# following 3 libraries were needed when we switched to installing cran
# libraries from source (because arm binaries not available)
# may be able to remove when arm cran binaries become available
libharfbuzz-dev \
libfribidi-dev \
libgit2-dev \
libfontconfig1-dev \
&& rm -rf /var/lib/apt/lists/*
# Freezing packages. Get available URLs at https://packagemanager.posit.co/client/#/repos/cran/setup
ARG PACKAGEDATE=2024-09-01
ARG TARGETPLATFORM
RUN case ${TARGETPLATFORM} in \
"linux/amd64") \
echo "options(repos = c(REPO_NAME = 'https://packagemanager.posit.co/cran/__linux__/jammy/${PACKAGEDATE}'))" >> $R_HOME/etc/Rprofile.site ;; \
"linux/arm64") \
echo "options(repos = c(REPO_NAME = 'https://packagemanager.posit.co/cran/${PACKAGEDATE}'))" >> $R_HOME/etc/Rprofile.site ;; \
esac
RUN R -e "options(warn = 2); install.packages(c('assertthat', \
'data.table', \
'dplyr', \
'DT', \
'elastic', \
'future', \
'future.callr', \
'ggplot2', \
'ggthemes', \
'httr', \
'jsonlite', \
'leaflet', \
'lubridate', \
'memoise', \
'plotly', \
'promises', \
'rmarkdown', \
'shiny', \
'shinycssloaders', \
'shinydashboard', \
'shinyjs', \
'shinyWidgets', \
'sf', \
'stringr', \
'timetk', \
'htmltools', \
'xml2'), Ncpus = max(1L, parallel::detectCores()))"
# Add certs for accessing elastic search servers that require them
COPY elasticsearch/certificates/*.crt /usr/local/share/ca-certificates/
RUN update-ca-certificates
# There is an issue using SSL on AMR images on mac due to this:
# https://stackoverflow.com/questions/75763525/curl-35-error0a000152ssl-routinesunsafe-legacy-renegotiation-disabled/76012131#76012131
# The following line fixes the issue, so that project images can once again
# use remotes::install_gitlab to install city of edmonton packages.
# We have put it in the base image in order to make things simple, however we
# should keep an eye out for a fix to this issue, and remove this line when that
# happens.
# Note, this could be called in the same RUN command as install_gitlab, and then
# sed -i "$d" /etc/ssl/openssl.cnf could be used to "undo" it, but we decided
# against this approach because this would mean the fix is distributed across
# many projects.
# Note that this fix actually gives us the same security setup as we had on
# earlier (0.3.*) images.
RUN echo "Options = UnsafeLegacyRenegotiation" >> /etc/ssl/openssl.cnf
RUN mkdir /shinyapp
WORKDIR /shinyapp/
ADD ./ ./
RUN useradd shiny -u 5000 -m -b /home
RUN chown -R shiny:shiny /shinyapp
USER shiny
EXPOSE 3838
CMD ["R", "-e", "shiny::runApp('/shinyapp', host = '0.0.0.0', port = 3838)"]