Spaces:
Sleeping
Sleeping
File size: 926 Bytes
15bde7f |
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 |
# Use R Shiny image
FROM rocker/shiny:latest
# Install necessary Linux dependencies
# CMake and libnlopt-dev added for nloptr
RUN apt-get update && apt-get install -y \
libcurl4-gnutls-dev \
libssl-dev \
libxml2-dev \
libudunits2-dev \
libgdal-dev \
libcairo2-dev \
libxt-dev \
libpq-dev \
libssh2-1-dev \
libharfbuzz-dev \
libfribidi-dev \
libgsl0-dev \
cmake \
libnlopt-dev \
libglpk-dev
# Clean up the apt cache to reduce the image size
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Copy your application files
COPY . /usr/src/app
RUN chown -R shiny:shiny /usr/src/app
# Set the working directory
WORKDIR /usr/src/app
# Install renv and restore packages
RUN Rscript -e 'install.packages("renv")'
RUN Rscript -e 'renv::restore()'
# Expose the port the app runs on
EXPOSE 7860
CMD ["R", "--quiet", "-e", "shiny::runApp(host='0.0.0.0', port=7860)"]
|