Dockerfile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # ---------------------------------------------
  2. # Overleaf Community Edition (overleaf/overleaf)
  3. # ---------------------------------------------
  4. FROM sharelatex/sharelatex-base:latest
  5. ENV baseDir .
  6. # Install app settings files
  7. # --------------------------
  8. ADD ${baseDir}/settings.coffee /etc/sharelatex/settings.coffee
  9. ENV SHARELATEX_CONFIG /etc/sharelatex/settings.coffee
  10. # Checkout Overleaf Community Edition repo
  11. # ----------------------------------------
  12. RUN git clone https://github.com/overleaf/overleaf.git \
  13. --depth 1 /var/www/sharelatex
  14. # Install dependencies needed to run configuration scripts
  15. # --------------------------------------------------------
  16. ADD ${baseDir}/package.json /var/www/package.json
  17. ADD ${baseDir}/git-revision.sh /var/www/git-revision.sh
  18. RUN cd /var/www && npm install
  19. # Replace overleaf/config/services.js with the list of available
  20. # services in Overleaf Community Edition
  21. # --------------------------------------------------------------
  22. ADD ${baseDir}/services.js /var/www/sharelatex/config/services.js
  23. # Checkout services
  24. # -----------------
  25. RUN cd /var/www/sharelatex && \
  26. npm install && grunt install;
  27. # install and compile services
  28. # ----------------------------
  29. RUN bash -c 'cd /var/www/sharelatex && source ./bin/install-services'
  30. RUN bash -c 'cd /var/www/sharelatex && source ./bin/compile-services'
  31. # Links CLSI sycntex to its default location
  32. # ------------------------------------------
  33. RUN ln -s /var/www/sharelatex/clsi/bin/synctex /opt/synctex
  34. # Copy runit service startup scripts to its location
  35. # --------------------------------------------------
  36. ADD ${baseDir}/runit /etc/service
  37. # Configure nginx
  38. # ---------------
  39. ADD ${baseDir}/nginx/nginx.conf /etc/nginx/nginx.conf
  40. ADD ${baseDir}/nginx/sharelatex.conf /etc/nginx/sites-enabled/sharelatex.conf
  41. # Configure log rotation
  42. # ----------------------
  43. ADD ${baseDir}/logrotate/sharelatex /etc/logrotate.d/sharelatex
  44. # Copy Phusion Image startup scripts to its location
  45. # --------------------------------------------------
  46. COPY ${baseDir}/init_scripts/ /etc/my_init.d/
  47. # Stores the version installed for each service
  48. # ---------------------------------------------
  49. RUN cd /var/www && ./git-revision.sh > revisions.txt
  50. # Set Environment Variables
  51. # --------------------------------
  52. ENV WEB_API_USER "sharelatex"
  53. ENV SHARELATEX_APP_NAME "Overleaf Community Edition"
  54. EXPOSE 80
  55. WORKDIR /
  56. ENTRYPOINT ["/sbin/my_init"]