Dockerfile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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.js /var/www/git-revision.js
  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. # Change application ownership to www-data
  32. # ----------------------------------------
  33. RUN chown -R www-data:www-data /var/www/sharelatex;
  34. # Copy runit service startup scripts to its location
  35. # --------------------------------------------------
  36. ADD ${baseDir}/runit /etc/service
  37. # Configure nginx
  38. # ---------------
  39. RUN rm /etc/nginx/sites-enabled/default
  40. ADD ${baseDir}/nginx/nginx.conf /etc/nginx/nginx.conf
  41. ADD ${baseDir}/nginx/sharelatex.conf /etc/nginx/sites-enabled/sharelatex.conf
  42. # Configure log rotation
  43. # ----------------------
  44. ADD ${baseDir}/logrotate/sharelatex /etc/logrotate.d/sharelatex
  45. # Copy Phusion Image startup scripts to its location
  46. # --------------------------------------------------
  47. COPY ${baseDir}/init_scripts/ /etc/my_init.d/
  48. # Stores the version installed for each service
  49. # ---------------------------------------------
  50. RUN cd /var/www && node git-revision > revisions.txt
  51. EXPOSE 80
  52. WORKDIR /
  53. ENTRYPOINT ["/sbin/my_init"]