Dockerfile-base 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. # Enable caching: https://docs.docker.com/reference/dockerfile/#example-cache-apt-packages
  14. RUN rm -f /etc/apt/apt.conf.d/docker-clean && echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache \
  15. && apt-get update \
  16. && apt-get install -y \
  17. unattended-upgrades \
  18. 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 \
  19. qpdf \
  20. # upgrade base-image, batch all the upgrades together, rather than installing them on-by-one (which is slow!)
  21. && unattended-upgrade --verbose --no-minimal-upgrade-steps \
  22. # install Node.js https://github.com/nodesource/distributions#nodejs
  23. && mkdir -p /etc/apt/keyrings \
  24. && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
  25. && 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 \
  26. && apt-get update \
  27. && apt-get install -y nodejs \
  28. \
  29. && rm -rf \
  30. # We are adding a custom nginx config in the main Dockerfile.
  31. /etc/nginx/nginx.conf \
  32. /etc/nginx/sites-enabled/default
  33. # Install TexLive
  34. # ---------------
  35. # CTAN mirrors occasionally fail, in that case install TexLive using a
  36. # different server, for example https://ctan.crest.fr
  37. #
  38. # # docker build \
  39. # --build-arg TEXLIVE_MIRROR=https://ctan.crest.fr/tex-archive/systems/texlive/tlnet \
  40. # -f Dockerfile-base -t sharelatex/sharelatex-base .
  41. ARG TEXLIVE_MIRROR=https://mirror.ox.ac.uk/sites/ctan.org/systems/texlive/tlnet
  42. RUN mkdir /install-tl-unx \
  43. && wget --quiet https://tug.org/texlive/files/texlive.asc \
  44. && gpg --import texlive.asc \
  45. && rm texlive.asc \
  46. && wget --quiet ${TEXLIVE_MIRROR}/install-tl-unx.tar.gz \
  47. && wget --quiet ${TEXLIVE_MIRROR}/install-tl-unx.tar.gz.sha512 \
  48. && wget --quiet ${TEXLIVE_MIRROR}/install-tl-unx.tar.gz.sha512.asc \
  49. && gpg --verify install-tl-unx.tar.gz.sha512.asc \
  50. && sha512sum -c install-tl-unx.tar.gz.sha512 \
  51. && tar -xz -C /install-tl-unx --strip-components=1 -f install-tl-unx.tar.gz \
  52. && rm install-tl-unx.tar.gz* \
  53. && echo "tlpdbopt_autobackup 0" >> /install-tl-unx/texlive.profile \
  54. && echo "tlpdbopt_install_docfiles 0" >> /install-tl-unx/texlive.profile \
  55. && echo "tlpdbopt_install_srcfiles 0" >> /install-tl-unx/texlive.profile \
  56. && echo "selected_scheme scheme-basic" >> /install-tl-unx/texlive.profile \
  57. \
  58. && /install-tl-unx/install-tl \
  59. -profile /install-tl-unx/texlive.profile \
  60. -repository ${TEXLIVE_MIRROR} \
  61. \
  62. && $(find /usr/local/texlive -name tlmgr) path add \
  63. && tlmgr install --repository ${TEXLIVE_MIRROR} \
  64. latexmk \
  65. texcount \
  66. synctex \
  67. etoolbox \
  68. xetex \
  69. && tlmgr path add \
  70. && rm -rf /install-tl-unx
  71. # Set up overleaf user and home directory
  72. # -----------------------------------------
  73. RUN adduser --system --group --home /overleaf --no-create-home overleaf && \
  74. mkdir -p /var/lib/overleaf && \
  75. chown www-data:www-data /var/lib/overleaf && \
  76. mkdir -p /var/log/overleaf && \
  77. chown www-data:www-data /var/log/overleaf && \
  78. mkdir -p /var/lib/overleaf/data/template_files && \
  79. chown www-data:www-data /var/lib/overleaf/data/template_files