Dockerfile-base 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. # --------------------------------------------------
  2. # Overleaf Base Image (sharelatex/sharelatex-base)
  3. # --------------------------------------------------
  4. FROM phusion/baseimage:jammy-1.0.4
  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="2024-07-09"
  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 imagemagick optipng strace nginx git python3 python-is-python3 zlib1g-dev libpcre3-dev gettext-base libwww-perl ca-certificates curl gnupg \
  17. qpdf \
  18. aspell aspell-en aspell-af aspell-am aspell-ar aspell-ar-large aspell-bg aspell-bn aspell-br aspell-ca aspell-cs aspell-cy aspell-da aspell-de aspell-de-1901 aspell-el aspell-eo aspell-es aspell-et aspell-eu-es aspell-fa aspell-fo aspell-fr aspell-ga aspell-gl-minimos aspell-gu aspell-he aspell-hi aspell-hr aspell-hsb aspell-hu aspell-hy aspell-id aspell-is aspell-it aspell-kk aspell-kn aspell-ku aspell-lt aspell-lv aspell-ml aspell-mr aspell-nl aspell-no aspell-nr aspell-ns aspell-pa aspell-pl aspell-pt aspell-pt-br aspell-ro aspell-ru aspell-sk aspell-sl aspell-ss aspell-st aspell-sv aspell-tl aspell-tn aspell-ts aspell-uk aspell-uz aspell-xh aspell-zu \
  19. && unattended-upgrade -v \
  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_18.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. /var/lib/apt/lists/*
  32. # Install TexLive
  33. # ---------------
  34. # CTAN mirrors occasionally fail, in that case install TexLive using a
  35. # different server, for example https://ctan.crest.fr
  36. #
  37. # # docker build \
  38. # --build-arg TEXLIVE_MIRROR=https://ctan.crest.fr/tex-archive/systems/texlive/tlnet \
  39. # -f Dockerfile-base -t sharelatex/sharelatex-base .
  40. ARG TEXLIVE_MIRROR=https://mirror.ox.ac.uk/sites/ctan.org/systems/texlive/tlnet
  41. RUN mkdir /install-tl-unx \
  42. && wget --quiet https://tug.org/texlive/files/texlive.asc \
  43. && gpg --import texlive.asc \
  44. && rm texlive.asc \
  45. && wget --quiet ${TEXLIVE_MIRROR}/install-tl-unx.tar.gz \
  46. && wget --quiet ${TEXLIVE_MIRROR}/install-tl-unx.tar.gz.sha512 \
  47. && wget --quiet ${TEXLIVE_MIRROR}/install-tl-unx.tar.gz.sha512.asc \
  48. && gpg --verify install-tl-unx.tar.gz.sha512.asc \
  49. && sha512sum -c install-tl-unx.tar.gz.sha512 \
  50. && tar -xz -C /install-tl-unx --strip-components=1 -f install-tl-unx.tar.gz \
  51. && rm install-tl-unx.tar.gz* \
  52. && echo "tlpdbopt_autobackup 0" >> /install-tl-unx/texlive.profile \
  53. && echo "tlpdbopt_install_docfiles 0" >> /install-tl-unx/texlive.profile \
  54. && echo "tlpdbopt_install_srcfiles 0" >> /install-tl-unx/texlive.profile \
  55. && echo "selected_scheme scheme-basic" >> /install-tl-unx/texlive.profile \
  56. \
  57. && /install-tl-unx/install-tl \
  58. -profile /install-tl-unx/texlive.profile \
  59. -repository ${TEXLIVE_MIRROR} \
  60. \
  61. && $(find /usr/local/texlive -name tlmgr) path add \
  62. && tlmgr install --repository ${TEXLIVE_MIRROR} \
  63. latexmk \
  64. texcount \
  65. synctex \
  66. etoolbox \
  67. xetex \
  68. && tlmgr path add \
  69. && rm -rf /install-tl-unx
  70. # Set up overleaf user and home directory
  71. # -----------------------------------------
  72. RUN adduser --system --group --home /overleaf --no-create-home overleaf && \
  73. mkdir -p /var/lib/overleaf && \
  74. chown www-data:www-data /var/lib/overleaf && \
  75. mkdir -p /var/log/overleaf && \
  76. chown www-data:www-data /var/log/overleaf && \
  77. mkdir -p /var/lib/overleaf/data/template_files && \
  78. chown www-data:www-data /var/lib/overleaf/data/template_files