-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (39 loc) · 1.21 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
# Base image https://hub.docker.com/u/rocker/
FROM rocker/shiny:latest
# system libraries of general use
## install debian packages
RUN apt-get update -qq && apt-get -y --no-install-recommends install \
libxml2-dev \
libcairo2-dev \
libsqlite3-dev \
libmariadbd-dev \
libpq-dev \
libssh2-1-dev \
unixodbc-dev \
libcurl4-openssl-dev \
libssl-dev \
perl
## update system libraries
RUN apt-get update && \
apt-get upgrade -y && \
apt-get clean
# renv.lock file
COPY renv.lock ./renv.lock
# install renv & restore packages
RUN Rscript -e 'install.packages("renv")'
RUN Rscript -e 'renv::consent(provided = TRUE)'
RUN Rscript -e 'renv::restore()'
RUN Rscript -e 'install.packages("Rcpp")' # Reinstall to fix errors
# Installing Python and Tensorflow
RUN Rscript -e 'reticulate::install_miniconda()'
RUN Rscript -e 'tensorflow::install_tensorflow()'
# PIL is used for image cropping, Scipy for statistics
RUN Rscript -e 'reticulate::py_install("Pillow")'
RUN Rscript -e 'reticulate::py_install("scipy")'
# copy necessary files
## app folder
COPY /app ./app
# expose port
EXPOSE 3838
# run app on container start
CMD ["R", "-e", "shiny::runApp('/app', host = '0.0.0.0', port = 3838)"]