Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- Dockerfile +1 -273
Dockerfile
CHANGED
|
@@ -1,281 +1,9 @@
|
|
| 1 |
-
FROM --
|
| 2 |
|
| 3 |
-
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
-
ENV TZ=Europe/Rome
|
| 5 |
-
ENV LANG=C.UTF-8
|
| 6 |
-
ENV LC_ALL=C.UTF-8
|
| 7 |
-
|
| 8 |
-
# =============================================================================
|
| 9 |
-
# 1. SYSTEM DEPENDENCIES
|
| 10 |
-
# =============================================================================
|
| 11 |
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 12 |
-
software-properties-common wget curl git ca-certificates gnupg dirmngr \
|
| 13 |
-
build-essential gfortran cmake pkg-config autoconf automake libtool \
|
| 14 |
-
libssl-dev libcurl4-openssl-dev libxml2-dev libgit2-dev \
|
| 15 |
-
libblas-dev liblapack-dev \
|
| 16 |
-
libfontconfig1-dev libfreetype6-dev libharfbuzz-dev libfribidi-dev \
|
| 17 |
-
libjpeg-dev libpng-dev libtiff-dev \
|
| 18 |
-
libcairo2-dev libpango1.0-dev libx11-dev libxt-dev \
|
| 19 |
-
libgdal-dev libgeos-dev libproj-dev libsqlite3-dev libudunits2-dev \
|
| 20 |
-
libgsl-dev libglpk-dev libfftw3-dev \
|
| 21 |
-
libhdf5-dev libnetcdf-dev libsodium-dev \
|
| 22 |
-
libbz2-dev liblzma-dev libzstd-dev libpcre2-dev libicu-dev zlib1g-dev \
|
| 23 |
-
libssh2-1-dev libzmq3-dev \
|
| 24 |
-
default-jdk-headless \
|
| 25 |
-
python3-full python3-pip python3-venv python3-dev \
|
| 26 |
-
pandoc \
|
| 27 |
-
texlive-latex-base \
|
| 28 |
-
texlive-latex-recommended \
|
| 29 |
-
texlive-latex-extra \
|
| 30 |
-
texlive-fonts-recommended \
|
| 31 |
-
texlive-plain-generic \
|
| 32 |
-
texlive-pictures \
|
| 33 |
-
tex-gyre \
|
| 34 |
-
libreadline-dev unzip zip \
|
| 35 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 36 |
-
|
| 37 |
-
# =============================================================================
|
| 38 |
-
# 2. R FROM UBUNTU UNIVERSE REPO (R 4.3.x)
|
| 39 |
-
# =============================================================================
|
| 40 |
-
RUN apt-get update && \
|
| 41 |
-
apt-get install -y --no-install-recommends \
|
| 42 |
-
r-base \
|
| 43 |
-
r-base-dev \
|
| 44 |
-
r-recommended \
|
| 45 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 46 |
-
|
| 47 |
-
RUN R CMD javareconf
|
| 48 |
-
|
| 49 |
-
# =============================================================================
|
| 50 |
-
# 3. CONFIGURE R REPOS (Posit Package Manager — binary packages)
|
| 51 |
-
# =============================================================================
|
| 52 |
-
RUN echo 'options(\
|
| 53 |
-
repos = c(\
|
| 54 |
-
PPM = "https://packagemanager.posit.co/cran/__linux__/noble/latest",\
|
| 55 |
-
CRAN = "https://cloud.r-project.org"\
|
| 56 |
-
),\
|
| 57 |
-
Ncpus = parallel::detectCores()\
|
| 58 |
-
)' >> /etc/R/Rprofile.site
|
| 59 |
-
|
| 60 |
-
# =============================================================================
|
| 61 |
-
# 4. R PACKAGES
|
| 62 |
-
# =============================================================================
|
| 63 |
-
|
| 64 |
-
# ── Batch 1: Infrastructure ─────────────────────────────────────────────────
|
| 65 |
-
RUN Rscript -e 'install.packages(c(\
|
| 66 |
-
"pak", "remotes", "BiocManager",\
|
| 67 |
-
"Rcpp", "BH", "RcppArmadillo", "RcppEigen", "RcppParallel", "cpp11",\
|
| 68 |
-
"rlang", "cli", "glue", "vctrs", "lifecycle", "withr",\
|
| 69 |
-
"fs", "digest", "cachem", "fastmap", "magrittr",\
|
| 70 |
-
"pkgconfig", "generics", "R6", "bit", "bit64", "blob"\
|
| 71 |
-
))'
|
| 72 |
-
|
| 73 |
-
# ── Batch 2: String / encoding / color ──────────────────────────────────────
|
| 74 |
-
RUN Rscript -e 'install.packages(c(\
|
| 75 |
-
"stringi", "stringr", "stringdist", "utf8", "fansi", "pillar", "crayon",\
|
| 76 |
-
"colorspace", "viridisLite", "viridis", "farver", "labeling",\
|
| 77 |
-
"scales", "munsell", "RColorBrewer", "prismatic"\
|
| 78 |
-
))'
|
| 79 |
-
|
| 80 |
-
# ── Batch 3: Core data manipulation ─────────────────────────────────────────
|
| 81 |
-
RUN Rscript -e 'install.packages(c(\
|
| 82 |
-
"tibble", "dplyr", "tidyr", "tidyselect", "purrr",\
|
| 83 |
-
"readr", "readxl", "haven", "hms", "tzdb",\
|
| 84 |
-
"vroom", "data.table", "dtplyr",\
|
| 85 |
-
"forcats", "lubridate", "timechange", "clock"\
|
| 86 |
-
))'
|
| 87 |
-
|
| 88 |
-
# ── Batch 4: rmarkdown / knitr (CRITICAL for the validator) ─────────────────
|
| 89 |
-
RUN Rscript -e 'install.packages(c(\
|
| 90 |
-
"xfun", "knitr", "rmarkdown", "htmltools", "evaluate",\
|
| 91 |
-
"yaml", "jsonlite", "base64enc", "jquerylib",\
|
| 92 |
-
"sass", "bslib", "fontawesome",\
|
| 93 |
-
"markdown", "commonmark", "highr", "litedown",\
|
| 94 |
-
"tinytex",\
|
| 95 |
-
"kableExtra", "gt", "DT", "htmlwidgets", "reactable"\
|
| 96 |
-
))'
|
| 97 |
-
|
| 98 |
-
# ── Batch 5: ggplot2 ecosystem ───────────────────────────────────────────────
|
| 99 |
-
RUN Rscript -e 'install.packages(c(\
|
| 100 |
-
"ggplot2", "gtable", "isoband",\
|
| 101 |
-
"ggrepel", "ggtext", "ggforce", "ggridges", "ggthemes",\
|
| 102 |
-
"ggpubr", "ggsignif", "rstatix",\
|
| 103 |
-
"GGally", "cowplot", "patchwork", "gridExtra",\
|
| 104 |
-
"ragg", "textshaping", "systemfonts",\
|
| 105 |
-
"showtext", "showtextdb", "sysfonts",\
|
| 106 |
-
"svglite"\
|
| 107 |
-
))'
|
| 108 |
-
|
| 109 |
-
# ── Batch 6: Statistical modeling ───────────────────────────────────────────
|
| 110 |
-
RUN Rscript -e 'install.packages(c(\
|
| 111 |
-
"lme4", "minqa", "nloptr", "nlme", "mgcv", "gamm4", "gam",\
|
| 112 |
-
"gamlss", "gamlss.dist",\
|
| 113 |
-
"survival", "survminer", "km.ci", "KMsurv",\
|
| 114 |
-
"glmnet", "glmnetUtils", "betareg", "ordinal",\
|
| 115 |
-
"lmtest", "sandwich", "multcomp", "emmeans",\
|
| 116 |
-
"car", "carData", "effects",\
|
| 117 |
-
"broom", "broom.helpers", "broom.mixed"\
|
| 118 |
-
))'
|
| 119 |
-
|
| 120 |
-
# ── Batch 7: Time series / finance ──────────────────────────────────────────
|
| 121 |
-
RUN Rscript -e 'install.packages(c(\
|
| 122 |
-
"forecast", "tseries", "xts", "zoo", "TTR", "quantmod",\
|
| 123 |
-
"tsibble", "fable", "feasts", "fabletools",\
|
| 124 |
-
"fracdiff", "urca", "MTS",\
|
| 125 |
-
"rugarch", "fGarch", "fBasics",\
|
| 126 |
-
"PerformanceAnalytics", "PortfolioAnalytics",\
|
| 127 |
-
"timeSeries", "timeDate",\
|
| 128 |
-
"vars", "strucchange"\
|
| 129 |
-
))'
|
| 130 |
-
|
| 131 |
-
# ── Batch 8: Actuarial science ───────────────────────────────────────────────
|
| 132 |
-
RUN Rscript -e 'install.packages(c(\
|
| 133 |
-
"actuar", "ChainLadder", "lifecontingencies",\
|
| 134 |
-
"MortalityLaws", "MortalityGaps", "MortCast", "StMoMo",\
|
| 135 |
-
"insuranceData", "insurancerating",\
|
| 136 |
-
"Delaporte", "NetSimR",\
|
| 137 |
-
"triangle", "Pareto",\
|
| 138 |
-
"QRM", "ReIns", "evd", "evir", "ismev", "extRemes",\
|
| 139 |
-
"DistributionUtils", "GeneralizedHyperbolic",\
|
| 140 |
-
"fitdistrplus", "MASS",\
|
| 141 |
-
"apc", "mondate"\
|
| 142 |
-
))'
|
| 143 |
-
|
| 144 |
-
# ── Batch 9: Copulas / extreme value / risk ──────────────────────────────────
|
| 145 |
-
RUN Rscript -e 'install.packages(c(\
|
| 146 |
-
"copula", "VineCopula",\
|
| 147 |
-
"mvtnorm", "mnormt", "tmvtnorm",\
|
| 148 |
-
"sn", "nortest", "moments",\
|
| 149 |
-
"logcondens", "truncnorm",\
|
| 150 |
-
"pROC", "ROCR", "PRROC",\
|
| 151 |
-
"ROSE", "smotefamily"\
|
| 152 |
-
))'
|
| 153 |
-
|
| 154 |
-
# ── Batch 10: Machine learning / tidymodels ──────────────────────────────────
|
| 155 |
-
RUN Rscript -e 'install.packages(c(\
|
| 156 |
-
"caret", "randomForest", "randomForestSRC", "ranger",\
|
| 157 |
-
"xgboost", "lightgbm", "gbm", "e1071", "kernlab",\
|
| 158 |
-
"glmnet", "MASS",\
|
| 159 |
-
"tidymodels", "parsnip", "workflows", "workflowsets",\
|
| 160 |
-
"recipes", "tune", "rsample", "yardstick", "dials",\
|
| 161 |
-
"themis", "hardhat", "infer",\
|
| 162 |
-
"DALEX", "iml", "shapviz", "SHAPforxgboost",\
|
| 163 |
-
"mlr3", "mlr3measures", "mlr3misc", "paradox"\
|
| 164 |
-
))'
|
| 165 |
-
|
| 166 |
-
# ── Batch 11: Spatial / GIS ──────────────────────────────────────────────────
|
| 167 |
-
RUN Rscript -e 'install.packages(c(\
|
| 168 |
-
"sf", "s2", "wk", "units",\
|
| 169 |
-
"terra", "raster", "stars", "sp",\
|
| 170 |
-
"spdep", "spatialreg",\
|
| 171 |
-
"spatstat", "spatstat.data", "spatstat.explore",\
|
| 172 |
-
"spatstat.geom", "spatstat.model", "spatstat.random", "spatstat.utils",\
|
| 173 |
-
"geosphere", "lwgeom",\
|
| 174 |
-
"tmap", "tmaptools", "mapview", "leaflet", "leafem",\
|
| 175 |
-
"maptiles",\
|
| 176 |
-
"gstat", "fields", "interp", "deldir",\
|
| 177 |
-
"geojsonsf", "spData"\
|
| 178 |
-
))'
|
| 179 |
-
|
| 180 |
-
# ── Batch 12: Network / graph ────────────────────────────────────────────────
|
| 181 |
-
RUN Rscript -e 'install.packages(c(\
|
| 182 |
-
"igraph", "network", "sna", "intergraph", "ergm",\
|
| 183 |
-
"ggraph", "tidygraph",\
|
| 184 |
-
"visNetwork", "networkD3", "DiagrammeR"\
|
| 185 |
-
))'
|
| 186 |
-
|
| 187 |
-
# ── Batch 13: Reporting / tables / output ───────────────────────────────────
|
| 188 |
-
RUN Rscript -e 'install.packages(c(\
|
| 189 |
-
"bookdown", "rticles", "prettydoc",\
|
| 190 |
-
"huxtable", "formattable", "stargazer", "texreg",\
|
| 191 |
-
"skimr", "janitor",\
|
| 192 |
-
"xtable", "openxlsx", "writexl", "readxl"\
|
| 193 |
-
))'
|
| 194 |
-
|
| 195 |
-
# ── Batch 14: Parallelism / workflow / utilities ─────────────────────────────
|
| 196 |
-
RUN Rscript -e 'install.packages(c(\
|
| 197 |
-
"foreach", "doParallel", "doFuture",\
|
| 198 |
-
"future", "future.apply", "furrr", "parallelly",\
|
| 199 |
-
"callr", "processx", "ps",\
|
| 200 |
-
"targets", "tarchetypes",\
|
| 201 |
-
"memoise", "cachem",\
|
| 202 |
-
"bench", "microbenchmark", "profvis"\
|
| 203 |
-
))'
|
| 204 |
-
|
| 205 |
-
# ── Batch 15: Database / storage ─────────────────────────────────────────────
|
| 206 |
-
RUN Rscript -e 'install.packages(c(\
|
| 207 |
-
"DBI", "RSQLite", "RPostgres", "RMySQL", "odbc",\
|
| 208 |
-
"dbplyr", "pool",\
|
| 209 |
-
"arrow", "nanoarrow", "feather",\
|
| 210 |
-
"fst", "qs", "vroom"\
|
| 211 |
-
))'
|
| 212 |
-
|
| 213 |
-
# ── Batch 16: Web / API / IO ─────────────────────────────────────────────────
|
| 214 |
-
RUN Rscript -e 'install.packages(c(\
|
| 215 |
-
"httr", "httr2", "curl", "rvest", "xml2", "XML",\
|
| 216 |
-
"jsonlite", "yaml",\
|
| 217 |
-
"googledrive", "googlesheets4", "gargle",\
|
| 218 |
-
"gh", "gitcreds", "credentials",\
|
| 219 |
-
"openssl", "sodium", "keyring"\
|
| 220 |
-
))'
|
| 221 |
-
|
| 222 |
-
# ── Batch 17: Dev tools / testing ────────────────────────────────────────────
|
| 223 |
-
RUN Rscript -e 'install.packages(c(\
|
| 224 |
-
"devtools", "usethis", "pkgbuild", "pkgload",\
|
| 225 |
-
"testthat", "mockery", "covr", "vdiffr",\
|
| 226 |
-
"roxygen2", "Rdpack",\
|
| 227 |
-
"sessioninfo", "desc", "rprojroot", "here",\
|
| 228 |
-
"reprex", "renv"\
|
| 229 |
-
))'
|
| 230 |
-
|
| 231 |
-
# ── Batch 18: Shiny / interactive ────────────────────────────────────────────
|
| 232 |
-
RUN Rscript -e 'install.packages(c(\
|
| 233 |
-
"shiny", "shinyWidgets", "shinyjs", "shinythemes",\
|
| 234 |
-
"miniUI", "crosstalk",\
|
| 235 |
-
"plotly", "dygraphs", "threejs",\
|
| 236 |
-
"leaflet", "leaflet.providers"\
|
| 237 |
-
))'
|
| 238 |
-
|
| 239 |
-
# ── Batch 19: Bayesian / MCMC ────────────────────────────────────────────────
|
| 240 |
-
RUN Rscript -e 'install.packages(c(\
|
| 241 |
-
"rstan", "StanHeaders", "rstantools", "bayesplot",\
|
| 242 |
-
"loo", "posterior", "bridgesampling",\
|
| 243 |
-
"MCMCpack", "coda",\
|
| 244 |
-
"bayestestR", "parameters", "performance", "insight",\
|
| 245 |
-
"effectsize", "correlation"\
|
| 246 |
-
))'
|
| 247 |
-
|
| 248 |
-
# ── Batch 20: Misc / datasets ────────────────────────────────────────────────
|
| 249 |
-
RUN Rscript -e 'install.packages(c(\
|
| 250 |
-
"Hmisc", "psych", "reshape2", "plyr",\
|
| 251 |
-
"validate", "assertthat", "checkmate",\
|
| 252 |
-
"lobstr", "uuid", "ids",\
|
| 253 |
-
"reticulate",\
|
| 254 |
-
"rJava",\
|
| 255 |
-
"nycflights13", "palmerpenguins", "gapminder",\
|
| 256 |
-
"ISLR", "AmesHousing", "Lahman",\
|
| 257 |
-
"plotly", "rgl",\
|
| 258 |
-
"wordcloud", "wordcloud2",\
|
| 259 |
-
"quanteda", "quanteda.textstats", "quanteda.textplots",\
|
| 260 |
-
"text2vec", "tokenizers", "tm", "SnowballC"\
|
| 261 |
-
))'
|
| 262 |
-
|
| 263 |
-
# =============================================================================
|
| 264 |
-
# 5. PYTHON DEPENDENCIES
|
| 265 |
-
# =============================================================================
|
| 266 |
WORKDIR /app
|
| 267 |
-
COPY requirements.txt /app/
|
| 268 |
-
RUN pip3 install --no-cache-dir --break-system-packages -r requirements.txt
|
| 269 |
-
|
| 270 |
-
# =============================================================================
|
| 271 |
-
# 6. APP FILES
|
| 272 |
-
# =============================================================================
|
| 273 |
COPY app.py validator.py /app/
|
| 274 |
RUN mkdir -p /app/temp /app/logs
|
| 275 |
|
| 276 |
-
# =============================================================================
|
| 277 |
-
# 7. HUGGING FACE SPACES — port 7860
|
| 278 |
-
# =============================================================================
|
| 279 |
ENV PORT=7860
|
| 280 |
EXPOSE 7860
|
| 281 |
|
|
|
|
| 1 |
+
FROM 070991/rmd-fixer-api:latest
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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