diff --git a/server-ce/Dockerfile-base b/server-ce/Dockerfile-base index 1ab78d93cd..ac2b4260ba 100644 --- a/server-ce/Dockerfile-base +++ b/server-ce/Dockerfile-base @@ -72,32 +72,39 @@ RUN mkdir -p /opt/quarto-extensions \ # Install TeX Live (for compiling .tex projects with latexmk) # ----------------------------------------------------------------------- # Verso compiles .qmd with Quarto and .tex with latexmk; both engines live -# side by side. Rather than (almost) all of texlive-full — which pulls in -# every CTAN package and takes ~20 min to build — we install a curated set -# of meta-packages covering the vast majority of real documents: the latex -# base/recommended/extra collections, recommended fonts, science/math -# packages, both alternative engines (xetex, luatex), and bibliography -# tooling. This is a few GB smaller and noticeably faster to build. +# side by side. # -# If a document needs a package not included here, add the relevant -# texlive-* collection below (e.g. texlive-fonts-extra, texlive-publishers, -# texlive-humanities) and rebuild. We deliberately omit inkscape, whose GTK -# GUI dependency tree is large and only needed for auto SVG->PDF conversion. +# MINIMAL install (current): the upstream-Overleaf approach — scheme-basic +# (~300 MB) plus a few essential packages via tlmgr. Fast to build and small. +# Many documents that need extra packages (tikz, beamer, siunitx, extra +# fonts, ...) will NOT compile out of the box; users can be told to keep +# those projects in Quarto/Typst for now. +# +# TO GO FULL LATER (when the project is mature): change +# selected_scheme scheme-basic -> scheme-full +# and optionally drop the explicit `tlmgr install` line. That single change +# restores a complete LaTeX toolchain at the cost of size/build time. +# Alternatively add individual packages to the `tlmgr install` list below. # ----------------------------------------------------------------------- -RUN apt-get update \ -&& apt-get install -y --no-install-recommends \ - texlive-latex-base \ - texlive-latex-recommended \ - texlive-latex-extra \ - texlive-fonts-recommended \ - texlive-plain-generic \ - texlive-science \ - texlive-xetex \ - texlive-luatex \ - texlive-bibtex-extra \ - texlive-extra-utils \ - latexmk biber chktex fontconfig python3-pygments \ -&& rm -rf /var/lib/apt/lists/* +ARG TEXLIVE_MIRROR=https://mirror.ox.ac.uk/sites/ctan.org/systems/texlive/tlnet +ENV PATH="${PATH}:/usr/local/texlive/bin/x86_64-linux" + +RUN mkdir /install-tl-unx \ +&& curl -sSL ${TEXLIVE_MIRROR}/install-tl-unx.tar.gz \ + | tar -xzC /install-tl-unx --strip-components=1 \ +&& echo "tlpdbopt_autobackup 0" >> /install-tl-unx/texlive.profile \ +&& echo "tlpdbopt_install_docfiles 0" >> /install-tl-unx/texlive.profile \ +&& echo "tlpdbopt_install_srcfiles 0" >> /install-tl-unx/texlive.profile \ +&& echo "selected_scheme scheme-basic" >> /install-tl-unx/texlive.profile \ +&& echo "TEXDIR /usr/local/texlive" >> /install-tl-unx/texlive.profile \ +&& /install-tl-unx/install-tl \ + -profile /install-tl-unx/texlive.profile \ + -repository ${TEXLIVE_MIRROR} \ +&& /usr/local/texlive/bin/x86_64-linux/tlmgr install \ + --repository ${TEXLIVE_MIRROR} \ + latexmk \ + texcount \ +&& rm -rf /install-tl-unx # Set up overleaf user and home directory