Dockerfile-base 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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/sharelatex/tmp/texmf-var
  8. # Install dependencies
  9. # --------------------
  10. RUN apt-get update \
  11. && apt-get install -y \
  12. build-essential wget net-tools unzip time imagemagick optipng strace nginx git python zlib1g-dev libpcre3-dev gettext-base libwww-perl \
  13. qpdf \
  14. 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 \
  15. \
  16. # install Node.JS 16
  17. && curl -sSL https://deb.nodesource.com/setup_16.x | bash - \
  18. && apt-get install -y nodejs \
  19. \
  20. && rm -rf \
  21. # We are adding a custom nginx config in the main Dockerfile.
  22. /etc/nginx/nginx.conf \
  23. /etc/nginx/sites-enabled/default \
  24. /var/lib/apt/lists/*
  25. # Install TexLive
  26. # ---------------
  27. # CTAN mirrors occasionally fail, in that case install TexLive using a
  28. # different server, for example https://ctan.crest.fr
  29. #
  30. # # docker build \
  31. # --build-arg TEXLIVE_MIRROR=https://ctan.crest.fr/tex-archive/systems/texlive/tlnet \
  32. # -f Dockerfile-base -t sharelatex/sharelatex-base .
  33. ARG TEXLIVE_MIRROR=https://mirror.ox.ac.uk/sites/ctan.org/systems/texlive/tlnet
  34. RUN mkdir /install-tl-unx \
  35. && wget --quiet https://tug.org/texlive/files/texlive.asc \
  36. && gpg --import texlive.asc \
  37. && rm texlive.asc \
  38. && wget --quiet ${TEXLIVE_MIRROR}/install-tl-unx.tar.gz \
  39. && wget --quiet ${TEXLIVE_MIRROR}/install-tl-unx.tar.gz.sha512 \
  40. && wget --quiet ${TEXLIVE_MIRROR}/install-tl-unx.tar.gz.sha512.asc \
  41. && gpg --verify install-tl-unx.tar.gz.sha512.asc \
  42. && sha512sum -c install-tl-unx.tar.gz.sha512 \
  43. && tar -xz -C /install-tl-unx --strip-components=1 -f install-tl-unx.tar.gz \
  44. && rm install-tl-unx.tar.gz* \
  45. && echo "tlpdbopt_autobackup 0" >> /install-tl-unx/texlive.profile \
  46. && echo "tlpdbopt_install_docfiles 0" >> /install-tl-unx/texlive.profile \
  47. && echo "tlpdbopt_install_srcfiles 0" >> /install-tl-unx/texlive.profile \
  48. && echo "selected_scheme scheme-basic" >> /install-tl-unx/texlive.profile \
  49. \
  50. && /install-tl-unx/install-tl \
  51. -profile /install-tl-unx/texlive.profile \
  52. -repository ${TEXLIVE_MIRROR} \
  53. \
  54. && $(find /usr/local/texlive -name tlmgr) path add \
  55. && tlmgr install --repository ${TEXLIVE_MIRROR} \
  56. latexmk \
  57. texcount \
  58. synctex \
  59. \
  60. && tlmgr path add \
  61. && rm -rf /install-tl-unx
  62. # Set up sharelatex user and home directory
  63. # -----------------------------------------
  64. RUN adduser --system --group --home /overleaf --no-create-home sharelatex && \
  65. mkdir -p /var/lib/sharelatex && \
  66. chown www-data:www-data /var/lib/sharelatex && \
  67. mkdir -p /var/log/sharelatex && \
  68. chown www-data:www-data /var/log/sharelatex && \
  69. mkdir -p /var/lib/sharelatex/data/template_files && \
  70. chown www-data:www-data /var/lib/sharelatex/data/template_files