2024-03-04 07:26:25 +00:00
|
|
|
FROM rocker/r-ver
|
|
|
|
|
|
|
|
# Create a new group and user for Shiny
|
|
|
|
RUN groupadd shiny && useradd -r -m shiny -g shiny
|
|
|
|
|
|
|
|
# Install system dependencies
|
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install -y --no-install-recommends \
|
|
|
|
pandoc \
|
|
|
|
pandoc-citeproc \
|
|
|
|
libcurl4-gnutls-dev \
|
|
|
|
libcairo2-dev \
|
|
|
|
libxt-dev \
|
|
|
|
xtail \
|
|
|
|
libssl-dev \
|
|
|
|
libicu-dev \
|
|
|
|
wget
|
|
|
|
|
|
|
|
# Install R packages
|
|
|
|
RUN R -e 'install.packages("remotes")'
|
|
|
|
RUN R -e "install.packages(c('dplyr', 'shiny', 'readxl', 'remotes', 'httpuv', 'shinythemes', 'DT', 'ggplot2', 'gridExtra', 'emmeans', 'officer', 'car', 'markdown', 'plotly', 'factoextra', 'shinylogs', 'auth0', 'httr', 'shinyjs'), repos = 'https://cran.rstudio.com/', method='wget')"
|
|
|
|
RUN R -e 'install_dev("shiny")'
|
|
|
|
|
|
|
|
# Create a directory for your Shiny app
|
|
|
|
RUN mkdir -p /srv/shiny && \
|
|
|
|
chown shiny:shiny /srv/shiny
|
|
|
|
|
|
|
|
# Copy the Shiny app to the container
|
|
|
|
COPY app.R /srv/shiny/app.R
|
|
|
|
COPY README.md /srv/shiny/README.md
|
|
|
|
COPY arbre1.png /srv/shiny/arbre1.png
|
|
|
|
COPY arbre2.png /srv/shiny/arbre2.png
|
|
|
|
COPY .Renviron /srv/shiny/.Renviron
|
|
|
|
|
|
|
|
# Expose the port Shiny app runs on
|
|
|
|
EXPOSE 8080
|
|
|
|
|
|
|
|
# Use the created shiny user
|
|
|
|
USER shiny
|
|
|
|
|
|
|
|
# Command to run the Shiny app
|
|
|
|
|
|
|
|
CMD ["R", "-e", "shiny::runApp('/srv/shiny', host='0.0.0.0', port=8080, launch.browser = FALSE)"]
|