CoolFace
Apppublic

softwareDevelopment/qtl_seq

sourceHugging Faceapache-2.0updated 28d agoView on Hugging Face
0likes
Dockerfile128 linesDownload Raw Back to root
1FROM rocker/shiny:latest2 3# Set working directory inside container4WORKDIR /code5 6# Install system dependencies7RUN apt-get update && apt-get install -y --no-install-recommends \8    libcurl4-openssl-dev \9    libssl-dev \10    libxml2-dev \11    libnlopt-dev \12    libicu-dev \13    libgdal-dev \14    libgeos-dev \15    libproj-dev \16    libv8-dev \17    libnode-dev \18    libglpk-dev \19    libglpk40 \20    libgmp-dev \21    zlib1g-dev \22    libbz2-dev \23    libgit2-dev \24    libudunits2-dev \25    libgsl-dev \26    && apt-get clean \27    && rm -rf /var/lib/apt/lists/*28 29# ---- IMPORTANT ----30# Every install step below is written WITHOUT the old31# "> log.log 2>&1 || cat log.log" pattern.32# That pattern always returns exit 0 (because `cat` succeeds even33# when the install failed), so Docker thought the build succeeded34# even when a package silently failed to install. Then app.R's35# library() calls would crash the app the instant it tried to start -36# which looks exactly like "Space won't start" with no clear cause.37# Now, if ANY package fails, the build fails immediately and you see38# exactly which package and why in the HF build log.39 40RUN install2.r --error --skipmissing --repo https://cloud.r-project.org \41    devtools \42    remotes43 44RUN install2.r --error --skipmissing --repo https://cloud.r-project.org \45    htmltools \46    htmlwidgets \47    jsonlite \48    crosstalk \49    magrittr \50    promises51 52RUN install2.r --error --skipmissing --repo https://cloud.r-project.org \53    nloptr \54    lme4 \55    emmeans \56    readxl \57    plotly \58    shinyjs \59    shinyWidgets \60    DT \61    RColorBrewer \62    ggrepel \63    openxlsx \64    randomForest \65    caret \66    writexl \67    viridis \68    tidyverse \69    shinythemes \70    shinyBS \71    data.table \72    dplyr \73    tidyr \74    qtlDesign75 76RUN install2.r --error --skipmissing --repo https://cloud.r-project.org \77    igraph \78    vcfR \79    dbscan \80    factoextra \81    cluster82 83RUN install2.r --error --repo https://cloud.r-project.org \84    qtl85 86RUN install2.r --error --repo https://cloud.r-project.org \87    ggplot2 \88    gridExtra \89    locfit90 91# Install QTLseqr from GitHub - fails the build immediately if it doesn't install92RUN R -e "options(timeout = 1200); \93          remotes::install_github('bmansfeld/QTLseqr'); \94          if (!requireNamespace('QTLseqr', quietly = TRUE)) { \95            stop('QTLseqr installation failed') \96          }"97 98# Install qtlTools from GitHub - fails the build immediately if it doesn't install99RUN R -e "options(timeout = 1200); \100          remotes::install_github('jtlovell/qtlTools'); \101          if (!requireNamespace('qtlTools', quietly = TRUE)) { \102            stop('qtlTools installation failed') \103          }"104 105# Final sanity check - confirms every package app.R actually loads is present106RUN R -e " \107  pkgs <- c('shiny','shinyjs','shinythemes','shinyBS','plotly','DT', \108            'QTLseqr','data.table','dplyr','tidyr','vcfR','ggplot2', \109            'dbscan','factoextra','cluster','viridis'); \110  missing <- pkgs[!sapply(pkgs, requireNamespace, quietly = TRUE)]; \111  if (length(missing) > 0) { \112    stop('Missing required packages: ', paste(missing, collapse=', ')) \113  } else { \114    cat('All required packages installed OK\n') \115  }"116 117# Create www directory and health file118RUN mkdir -p /code/www && echo "OK" > /code/www/health119 120# Copy app code121COPY app.R /code/122 123# Expose the port Shiny will run on124EXPOSE 7860125 126# Run the app127CMD ["R", "--quiet", "-e", "shiny::runApp('/code', host='0.0.0.0', port=7860)"]128