# Use rocker/geospatial as the base image to include necessary geospatial libraries | |
FROM rocker/geospatial:latest | |
# Set the working directory inside the container | |
WORKDIR /code | |
# Install required R packages, excluding suggested dependencies to avoid rnaturalearthhires error | |
RUN Rscript -e "install.packages(c('shiny', 'shinydashboard', 'dplyr', 'readr', 'sf', 'cartogram', 'ggplot2', 'rnaturalearth', 'rnaturalearthdata', 'countrycode', 'DT', 'ggExtra', 'viridis','ggiraph','extrafont','leaflet'), dependencies = c('Depends', 'Imports', 'LinkingTo'), repos = 'https://cran.r-project.org')" | |
# Copy the current directory (containing app.R and data) into the container | |
COPY . . | |
# Run the Shiny app | |
CMD ["R", "--quiet", "-e", "shiny::runApp(host='0.0.0.0', port=7860)"] |