FROM rocker/shiny:latest # Set working directory inside container WORKDIR /code # Install system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ libcurl4-openssl-dev \ libssl-dev \ libxml2-dev \ libnlopt-dev \ libicu-dev \ libgdal-dev \ libgeos-dev \ libproj-dev \ libv8-dev \ libnode-dev \ libglpk-dev \ libglpk40 \ libgmp-dev \ zlib1g-dev \ libbz2-dev \ libgit2-dev \ libudunits2-dev \ libgsl-dev \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # ---- IMPORTANT ---- # Every install step below is written WITHOUT the old # "> log.log 2>&1 || cat log.log" pattern. # That pattern always returns exit 0 (because `cat` succeeds even # when the install failed), so Docker thought the build succeeded # even when a package silently failed to install. Then app.R's # library() calls would crash the app the instant it tried to start - # which looks exactly like "Space won't start" with no clear cause. # Now, if ANY package fails, the build fails immediately and you see # exactly which package and why in the HF build log. RUN install2.r --error --skipmissing --repo https://cloud.r-project.org \ devtools \ remotes RUN install2.r --error --skipmissing --repo https://cloud.r-project.org \ htmltools \ htmlwidgets \ jsonlite \ crosstalk \ magrittr \ promises RUN install2.r --error --skipmissing --repo https://cloud.r-project.org \ nloptr \ lme4 \ emmeans \ readxl \ plotly \ shinyjs \ shinyWidgets \ DT \ RColorBrewer \ ggrepel \ openxlsx \ randomForest \ caret \ writexl \ viridis \ tidyverse \ shinythemes \ shinyBS \ data.table \ dplyr \ tidyr \ qtlDesign RUN install2.r --error --skipmissing --repo https://cloud.r-project.org \ igraph \ vcfR \ dbscan \ factoextra \ cluster RUN install2.r --error --repo https://cloud.r-project.org \ qtl RUN install2.r --error --repo https://cloud.r-project.org \ ggplot2 \ gridExtra \ locfit # Install QTLseqr from GitHub - fails the build immediately if it doesn't install RUN R -e "options(timeout = 1200); \ remotes::install_github('bmansfeld/QTLseqr'); \ if (!requireNamespace('QTLseqr', quietly = TRUE)) { \ stop('QTLseqr installation failed') \ }" # Install qtlTools from GitHub - fails the build immediately if it doesn't install RUN R -e "options(timeout = 1200); \ remotes::install_github('jtlovell/qtlTools'); \ if (!requireNamespace('qtlTools', quietly = TRUE)) { \ stop('qtlTools installation failed') \ }" # Final sanity check - confirms every package app.R actually loads is present RUN R -e " \ pkgs <- c('shiny','shinyjs','shinythemes','shinyBS','plotly','DT', \ 'QTLseqr','data.table','dplyr','tidyr','vcfR','ggplot2', \ 'dbscan','factoextra','cluster','viridis'); \ missing <- pkgs[!sapply(pkgs, requireNamespace, quietly = TRUE)]; \ if (length(missing) > 0) { \ stop('Missing required packages: ', paste(missing, collapse=', ')) \ } else { \ cat('All required packages installed OK\n') \ }" # Create www directory and health file RUN mkdir -p /code/www && echo "OK" > /code/www/health # Copy app code COPY app.R /code/ # Expose the port Shiny will run on EXPOSE 7860 # Run the app CMD ["R", "--quiet", "-e", "shiny::runApp('/code', host='0.0.0.0', port=7860)"]