Dockerfile 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. # ---------------------------------------------
  2. # Overleaf Community Edition (overleaf/overleaf)
  3. # ---------------------------------------------
  4. ARG SHARELATEX_BASE_TAG=sharelatex/sharelatex-base:latest
  5. FROM $SHARELATEX_BASE_TAG
  6. WORKDIR /var/www/sharelatex
  7. # Add required source files
  8. # -------------------------
  9. ADD ${baseDir}/genScript.js /var/www/sharelatex/genScript.js
  10. ADD ${baseDir}/services.js /var/www/sharelatex/services.js
  11. # Checkout services
  12. # -----------------
  13. RUN node genScript checkout | bash \
  14. \
  15. # Store the revision for each service
  16. # ---------------------------------------------
  17. && node genScript revisions | bash > revisions.txt \
  18. \
  19. # Cleanup the git history
  20. # -------------------
  21. && node genScript cleanup-git | bash
  22. # Install npm dependencies
  23. # ------------------------
  24. RUN node genScript install | bash
  25. # Compile
  26. # --------------------
  27. RUN node genScript compile | bash
  28. # Links CLSI synctex to its default location
  29. # ------------------------------------------
  30. RUN ln -s /var/www/sharelatex/clsi/bin/synctex /opt/synctex
  31. # Copy runit service startup scripts to its location
  32. # --------------------------------------------------
  33. ADD ${baseDir}/runit /etc/service
  34. # Configure nginx
  35. # ---------------
  36. ADD ${baseDir}/nginx/nginx.conf.template /etc/nginx/templates/nginx.conf.template
  37. ADD ${baseDir}/nginx/sharelatex.conf /etc/nginx/sites-enabled/sharelatex.conf
  38. # Configure log rotation
  39. # ----------------------
  40. ADD ${baseDir}/logrotate/sharelatex /etc/logrotate.d/sharelatex
  41. RUN chmod 644 /etc/logrotate.d/sharelatex
  42. # Copy Phusion Image startup scripts to its location
  43. # --------------------------------------------------
  44. COPY ${baseDir}/init_scripts/ /etc/my_init.d/
  45. # Copy app settings files
  46. # -----------------------
  47. COPY ${baseDir}/settings.js /etc/sharelatex/settings.js
  48. # Copy grunt thin wrapper
  49. # -----------------------
  50. ADD ${baseDir}/bin/grunt /usr/local/bin/grunt
  51. RUN chmod +x /usr/local/bin/grunt
  52. # Set Environment Variables
  53. # --------------------------------
  54. ENV SHARELATEX_CONFIG /etc/sharelatex/settings.js
  55. ENV WEB_API_USER "sharelatex"
  56. ENV SHARELATEX_APP_NAME "Overleaf Community Edition"
  57. ENV OPTIMISE_PDF "true"
  58. EXPOSE 80
  59. WORKDIR /
  60. ENTRYPOINT ["/sbin/my_init"]