Dockerfile-base 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # --------------------------------------------------
  2. # Overleaf Base Image (sharelatex/sharelatex-base)
  3. # --------------------------------------------------
  4. FROM phusion/baseimage:focal-1.2.0
  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="2023-11-02"
  11. # Install dependencies
  12. # --------------------
  13. RUN apt-get update \
  14. && apt-get install -y \
  15. build-essential wget net-tools unzip time imagemagick optipng strace nginx git python zlib1g-dev libpcre3-dev gettext-base libwww-perl ca-certificates curl gnupg \
  16. qpdf \
  17. 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 \
  18. \
  19. # install Node.js https://github.com/nodesource/distributions#nodejs
  20. && mkdir -p /etc/apt/keyrings \
  21. && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
  22. && 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 \
  23. && apt-get update \
  24. && apt-get install -y nodejs \
  25. \
  26. && rm -rf \
  27. # We are adding a custom nginx config in the main Dockerfile.
  28. /etc/nginx/nginx.conf \
  29. /etc/nginx/sites-enabled/default \
  30. /var/lib/apt/lists/*
  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