forked from InseeFrLab/template-shiny-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
24 lines (20 loc) · 889 Bytes
/
Dockerfile
File metadata and controls
24 lines (20 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Base image
FROM rocker/shiny:4.1.2
# Install required linux librairies
RUN apt-get update -y && \
apt-get install -y --no-install-recommends libpq-dev \
libssl-dev \
libxml2-dev \
gdal-bin \
libgdal-dev
# Install R package and its dependencies
RUN install2.r remotes
COPY myshinyapp/ ./myshinyapp
RUN Rscript -e 'remotes::install_deps("./myshinyapp")'
RUN Rscript -e 'install.packages("./myshinyapp", repos = NULL, type="source")'
# Expose port where shiny app will broadcast
ARG SHINY_PORT=3838
EXPOSE $SHINY_PORT
RUN echo "local({options(shiny.port = ${SHINY_PORT}, shiny.host = '0.0.0.0')})" >> /usr/local/lib/R/etc/Rprofile.site
# Endpoint
CMD ["Rscript", "-e", "myshinyapp::runApp()"]