TealPages / Dockerfile
igroffman's picture
Update Dockerfile
4254022 verified
FROM rocker/shiny:latest
# Work in /code (HF/Render/Heroku-friendly)
WORKDIR /code
# System dependencies for htmltools/bslib/sass, curl/openssl/xml, and image formats
RUN apt-get update && apt-get install -y --no-install-recommends \
libcurl4-openssl-dev \
libssl-dev \
libxml2-dev \
libfontconfig1-dev \
libfreetype6-dev \
libharfbuzz-dev \
libfribidi-dev \
libpng-dev \
libjpeg-dev \
libtiff5-dev \
libwebp-dev \
libgl1-mesa-dev \
&& rm -rf /var/lib/apt/lists/*
# R packages used by the app (skip those already present)
RUN install2.r --error --skipinstalled \
shiny \
DT \
dplyr \
readxl \
scales \
readr \
tidyverse \
bslib \
htmltools \
shinyWidgets \
ggplot2 \
shinyjs \
&& R -q -e "update.packages(ask = FALSE, checkBuilt = TRUE)"
# Copy app files
COPY . .
# Default port used by Spaces; adjust if your platform injects PORT
ENV PORT=7860
EXPOSE 7860
# Run the app
CMD ["R", "--quiet", "-e", "shiny::runApp(host='0.0.0.0', port=as.integer(Sys.getenv('PORT', '7860')))"]