-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
80 lines (66 loc) · 2.57 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
FROM rocker/shiny:4.4.0
#FROM rocker/shiny:latest
#FROM rocker/r-ver:4.4.0
#FROM rocker/r-ver:latest
LABEL org.opencontainers.image.authors="[email protected]" org.opencontainers.image.authors="[email protected]"
LABEL maintainer="Julien Barde <[email protected]>"
#connect this container (GHitHub package) to the repository
LABEL org.opencontainers.image.source https://github.com/firms-gta/shiny_compare_tunaatlas_datasests
# Update and upgrade the system with option -y to tells apt-get to assume the answer to all prompts is yes.
RUN apt update && apt upgrade -y
# Install system libraries of general use with option -y to tells apt-get to assume the answer to all prompts is yes.
RUN apt install -y \
#sudo \
#pandoc \
pandoc-citeproc \
libssl-dev \
#libcurl4-openssl-dev \
#libxml2-dev \
libudunits2-dev \
libproj-dev \
libgeos-dev \
libgdal-dev \
libv8-dev \
libsodium-dev \
libsecret-1-dev \
git \
libnetcdf-dev \
curl \
libprotobuf-dev \
protobuf-compiler \
libjq-dev \
#libicu-dev \
cmake
## update system libraries
RUN apt update && apt upgrade -y && apt clean
# Install R core package dependencies (we might specify the version of renv package)
RUN R -e "install.packages('renv', repos='https://cran.r-project.org/')"
# FROM ghcr.io/firms-gta/shiny_compare_tunaatlas_datasests-cache AS base
# Set environment variables for renv cache, see doc https://docs.docker.com/build/cache/backends/
ARG RENV_PATHS_ROOT
# Make a directory in the container
RUN mkdir -p ${RENV_PATHS_ROOT}
# Set the working directory
WORKDIR /root/shiny_compare_tunaatlas_datasests
# Copy renv configuration and lockfile
COPY renv.lock ./
COPY .Rprofile ./
COPY renv/activate.R renv/activate.R
COPY renv/settings.json renv/settings.json
#COPY renv renv
# Set renv cache location: change default location of cache to project folder
# see documentation for Multi-stage builds => https://cran.r-project.org/web/packages/renv/vignettes/docker.html
RUN mkdir renv/.cache
ENV RENV_PATHS_CACHE=renv/.cache
# Restore renv packages
RUN R -e "renv::restore()"
#FROM ghcr.io/firms-gta/shiny_compare_tunaatlas_datasests-cache
# Copy the rest of the application code
COPY . .
# Create directories for configuration
RUN mkdir -p /etc/shiny_compare_tunaatlas_datasests/
# Expose port 3838 for the Shiny app
EXPOSE 3838
# Define the entry point to run the Shiny app
CMD ["R", "-e", "shiny::runApp('/root/shiny_compare_tunaatlas_datasests'"]
#CMD ["R", "-e", "renv::restore() ; shiny::runApp('/root/tunaatlas_pie_map_shiny', port=3838, host='0.0.0.0')"]