Skip to content

Commit

Permalink
Add appli entry-point to new dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
davide-vitiello committed Nov 29, 2024
1 parent 9548a9e commit ac2b85c
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions docker/Dockerfile.oasisui_appli
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
FROM rocker/r-ver:4.0.5
FROM rocker/r-ver:4.0.5
# -> ubuntu 20.04
# -> don't use latest R release, since that will keep getting linked with later build-dates and RStudio packagemanager
# -> sets repository to RStudio packagemanager for specific build date of R version, being 2021-05-17 for R 4.0.5
# (see https://github.com/rocker-org/rocker-versioned2/blob/master/dockerfiles/r-ver_4.0.5.Dockerfile for reference)
# -> installs R to /usr/local/lib/R

RUN apt-get update && apt-get upgrade -y && \
apt-get install -y --no-install-recommends libnode-dev libcairo2-dev libxt-dev libcurl4-gnutls-dev libssl-dev libssh2-1-dev libxml2-dev apt-utils libjq-dev gdal-bin proj-bin libgdal-dev libudunits2-dev && \
# if desired, add tools such as: sudo, vim, wget, curl, procps
# library necessary for dependency of geojsonio
apt-get install -y libprotobuf-dev protobuf-compiler && \
apt-get install -y tzdata && \
rm -rf /var/lib/apt/lists/*

# libcairo2-dev and libxt-dev needed for Cairo, e.g. graphics
# libcurl4-openssl-dev and libcurl4-gnutls-dev are mutually exclusive. we choose GNU TLS, which seems preferred on Ubuntu / Debian systems and is recommended e.g. by RStudio
# libssl-dev depends on libssl1.1, which in turn depends on libc6
# (libcurl4-openssl-dev / openssl would depend on libc6 and libssl1.1 as well)

# Install Oasisui with dependencies
ARG REF_BRANCH
ENV REF_BRANCH=${REF_BRANCH:-master}
RUN R -e "install.packages('remotes')" && \
# installing older version of package shinyjs from GitHub
R -e "remotes::install_github('daattali/shinyjs', ref = 'v1.1', upgrade = 'always')" && \
R -e "remotes::install_github('OasisLMF/OasisUI', ref = '${REF_BRANCH}', subdir = 'BFE_RShiny/oasisui')" && \
rm -rf /var/lib/apt/lists/*

# Create the logging directory
RUN mkdir /var/log/shiny-server

# Make root directory
RUN mkdir -p /root
WORKDIR /root

# Add shiny options upon startup
COPY shinyproxy/Rprofile.site /usr/local/lib/R/etc/

# Set port
EXPOSE 3838

# Use below for stand-alone build, i.e. without shinyproxy
# ARG API_IP_CMD_RES
# ENV API_IP=${API_IP_CMD_RES:-0.0.0.0}
# ENV API_PORT=8000
# ENV API_VERSION=v1
# ENV API_SHARE_FILEPATH=./downloads
# ENV OASIS_ENVIRONMENT=oasis_localhost
# ENV MAX_UPLOAD_SIZE=500
# ENV HIDE_FOOTER_VERSION=TRUE

# Launch Oasisui
CMD ["R", "-e", "oasisui::runOasisui(mode="appli")"]

0 comments on commit ac2b85c

Please sign in to comment.