Dockerfile-base 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 \
  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-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-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. # Add envsubst
  26. # ------------
  27. ADD server-ce/vendor/envsubst /usr/bin/envsubst
  28. RUN chmod +x /usr/bin/envsubst
  29. # Install TexLive
  30. # ---------------
  31. # CTAN mirrors occasionally fail, in that case install TexLive using a
  32. # different server, for example https://ctan.crest.fr
  33. #
  34. # # docker build \
  35. # --build-arg TEXLIVE_MIRROR=https://ctan.crest.fr/tex-archive/systems/texlive/tlnet \
  36. # -f Dockerfile-base -t sharelatex/sharelatex-base .
  37. ARG TEXLIVE_MIRROR=https://mirror.ox.ac.uk/sites/ctan.org/systems/texlive/tlnet
  38. RUN mkdir /install-tl-unx \
  39. && wget --quiet https://tug.org/texlive/files/texlive.asc \
  40. && gpg --import texlive.asc \
  41. && rm texlive.asc \
  42. && wget --quiet ${TEXLIVE_MIRROR}/install-tl-unx.tar.gz \
  43. && wget --quiet ${TEXLIVE_MIRROR}/install-tl-unx.tar.gz.sha512 \
  44. && wget --quiet ${TEXLIVE_MIRROR}/install-tl-unx.tar.gz.sha512.asc \
  45. && gpg --verify install-tl-unx.tar.gz.sha512.asc \
  46. && sha512sum -c install-tl-unx.tar.gz.sha512 \
  47. && tar -xz -C /install-tl-unx --strip-components=1 -f install-tl-unx.tar.gz \
  48. && rm install-tl-unx.tar.gz* \
  49. && echo "tlpdbopt_autobackup 0" >> /install-tl-unx/texlive.profile \
  50. && echo "tlpdbopt_install_docfiles 0" >> /install-tl-unx/texlive.profile \
  51. && echo "tlpdbopt_install_srcfiles 0" >> /install-tl-unx/texlive.profile \
  52. && echo "selected_scheme scheme-basic" >> /install-tl-unx/texlive.profile \
  53. \
  54. && /install-tl-unx/install-tl \
  55. -profile /install-tl-unx/texlive.profile \
  56. -repository ${TEXLIVE_MIRROR} \
  57. \
  58. && $(find /usr/local/texlive -name tlmgr) path add \
  59. && tlmgr install --repository ${TEXLIVE_MIRROR} \
  60. latexmk \
  61. texcount \
  62. synctex \
  63. \
  64. && tlmgr path add \
  65. && rm -rf /install-tl-unx
  66. # Set up sharelatex user and home directory
  67. # -----------------------------------------
  68. RUN adduser --system --group --home /overleaf --no-create-home sharelatex && \
  69. mkdir -p /var/lib/sharelatex && \
  70. chown www-data:www-data /var/lib/sharelatex && \
  71. mkdir -p /var/log/sharelatex && \
  72. chown www-data:www-data /var/log/sharelatex && \
  73. mkdir -p /var/lib/sharelatex/data/template_files && \
  74. chown www-data:www-data /var/lib/sharelatex/data/template_files