Dockerfile-base 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # --------------------------------------------------
  2. # Overleaf Base Image (sharelatex/sharelatex-base)
  3. # --------------------------------------------------
  4. FROM phusion/baseimage:noble-1.0.3
  5. # Makes sure LuaTex cache is writable
  6. # -----------------------------------
  7. ENV TEXMFVAR=/var/lib/overleaf/tmp/texmf-var
  8. # Update to ensure dependencies are updated
  9. # ------------------------------------------
  10. ENV REBUILT_AFTER="2026-06-05"
  11. # Install dependencies
  12. # --------------------
  13. RUN apt-get update \
  14. && apt-get install -y \
  15. unattended-upgrades \
  16. build-essential wget net-tools unzip time poppler-utils optipng strace nginx git python3 python-is-python3 zlib1g-dev libpcre3-dev gettext-base libwww-perl ca-certificates curl gnupg \
  17. qpdf \
  18. # upgrade base-image, batch all the upgrades together, rather than installing them on-by-one (which is slow!)
  19. && unattended-upgrade --verbose --no-minimal-upgrade-steps \
  20. # install Node.js https://github.com/nodesource/distributions#nodejs
  21. && mkdir -p /etc/apt/keyrings \
  22. && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
  23. && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
  24. && apt-get update \
  25. && apt-get install -y nodejs \
  26. \
  27. && rm -rf \
  28. # We are adding a custom nginx config in the main Dockerfile.
  29. /etc/nginx/nginx.conf \
  30. /etc/nginx/sites-enabled/default
  31. # Install TexLive
  32. # ---------------
  33. # CTAN mirrors occasionally fail, in that case install TexLive using a
  34. # different server, for example https://ctan.crest.fr
  35. #
  36. # # docker build \
  37. # --build-arg TEXLIVE_MIRROR=https://ctan.crest.fr/tex-archive/systems/texlive/tlnet \
  38. # -f Dockerfile-base -t sharelatex/sharelatex-base .
  39. ARG TEXLIVE_MIRROR=https://mirror.ox.ac.uk/sites/ctan.org/systems/texlive/tlnet
  40. RUN mkdir /install-tl-unx \
  41. && wget --quiet https://tug.org/texlive/files/texlive.asc \
  42. && gpg --import texlive.asc \
  43. && rm texlive.asc \
  44. && wget --quiet ${TEXLIVE_MIRROR}/install-tl-unx.tar.gz \
  45. && wget --quiet ${TEXLIVE_MIRROR}/install-tl-unx.tar.gz.sha512 \
  46. && wget --quiet ${TEXLIVE_MIRROR}/install-tl-unx.tar.gz.sha512.asc \
  47. && gpg --verify install-tl-unx.tar.gz.sha512.asc \
  48. && sha512sum -c install-tl-unx.tar.gz.sha512 \
  49. && tar -xz -C /install-tl-unx --strip-components=1 -f install-tl-unx.tar.gz \
  50. && rm install-tl-unx.tar.gz* \
  51. && echo "tlpdbopt_autobackup 0" >> /install-tl-unx/texlive.profile \
  52. && echo "tlpdbopt_install_docfiles 0" >> /install-tl-unx/texlive.profile \
  53. && echo "tlpdbopt_install_srcfiles 0" >> /install-tl-unx/texlive.profile \
  54. && echo "selected_scheme scheme-basic" >> /install-tl-unx/texlive.profile \
  55. \
  56. && /install-tl-unx/install-tl \
  57. -profile /install-tl-unx/texlive.profile \
  58. -repository ${TEXLIVE_MIRROR} \
  59. \
  60. && $(find /usr/local/texlive -name tlmgr) path add \
  61. && tlmgr install --repository ${TEXLIVE_MIRROR} \
  62. latexmk \
  63. texcount \
  64. synctex \
  65. etoolbox \
  66. xetex \
  67. && tlmgr path add \
  68. && rm -rf /install-tl-unx
  69. # Set up overleaf user and home directory
  70. # -----------------------------------------
  71. RUN adduser --system --group --home /overleaf --no-create-home overleaf && \
  72. mkdir -p /var/lib/overleaf && \
  73. chown www-data:www-data /var/lib/overleaf && \
  74. mkdir -p /var/log/overleaf && \
  75. chown www-data:www-data /var/log/overleaf && \
  76. mkdir -p /var/lib/overleaf/data/template_files && \
  77. chown www-data:www-data /var/lib/overleaf/data/template_files