Dockerfile-base 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # --------------------------------------------------
  2. # Overleaf Base Image (sharelatex/sharelatex-base)
  3. # --------------------------------------------------
  4. FROM phusion/baseimage:0.11
  5. ENV baseDir .
  6. # Makes sure LuaTex cache is writable
  7. # -----------------------------------
  8. ENV TEXMFVAR=/var/lib/sharelatex/tmp/texmf-var
  9. # Install dependencies
  10. # --------------------
  11. RUN apt-get update \
  12. && apt-get install -y \
  13. build-essential wget net-tools unzip time imagemagick optipng strace nginx git python zlib1g-dev libpcre3-dev \
  14. qpdf \
  15. 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 \
  16. \
  17. # install Node.JS 12
  18. && curl -sSL https://deb.nodesource.com/setup_12.x | bash - \
  19. && apt-get install -y nodejs \
  20. \
  21. && rm -rf \
  22. # We are adding a custom nginx config in the main Dockerfile.
  23. /etc/nginx/nginx.conf \
  24. /etc/nginx/sites-enabled/default \
  25. /var/lib/apt/lists/*
  26. # Add envsubst
  27. # ------------
  28. ADD ./vendor/envsubst /usr/bin/envsubst
  29. RUN chmod +x /usr/bin/envsubst
  30. # Install TexLive
  31. # ---------------
  32. # CTAN mirrors occasionally fail, in that case install TexLive against an
  33. # specific server, for example http://ctan.crest.fr
  34. #
  35. # # docker build \
  36. # --build-arg TEXLIVE_MIRROR=http://ctan.crest.fr/tex-archive/systems/texlive/tlnet \
  37. # -f Dockerfile-base -t sharelatex/sharelatex-base .
  38. ARG TEXLIVE_MIRROR=http://mirror.ctan.org/systems/texlive/tlnet
  39. ENV PATH "${PATH}:/usr/local/texlive/2021/bin/x86_64-linux"
  40. RUN mkdir /install-tl-unx \
  41. && curl -sSL \
  42. ${TEXLIVE_MIRROR}/install-tl-unx.tar.gz \
  43. | tar -xzC /install-tl-unx --strip-components=1 \
  44. \
  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. && tlmgr install --repository ${TEXLIVE_MIRROR} \
  55. latexmk \
  56. texcount \
  57. \
  58. && rm -rf /install-tl-unx
  59. # Set up sharelatex user and home directory
  60. # -----------------------------------------
  61. RUN adduser --system --group --home /var/www/sharelatex --no-create-home sharelatex && \
  62. mkdir -p /var/lib/sharelatex && \
  63. chown www-data:www-data /var/lib/sharelatex && \
  64. mkdir -p /var/log/sharelatex && \
  65. chown www-data:www-data /var/log/sharelatex && \
  66. mkdir -p /var/lib/sharelatex/data/template_files && \
  67. chown www-data:www-data /var/lib/sharelatex/data/template_files