Dockerfile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # Etherpad Lite Dockerfile
  2. #
  3. # https://github.com/ether/etherpad-lite
  4. #
  5. # Author: muxator
  6. FROM node:10-buster-slim
  7. LABEL maintainer="Etherpad team, https://github.com/ether/etherpad-lite"
  8. # plugins to install while building the container. By default no plugins are
  9. # installed.
  10. # If given a value, it has to be a space-separated, quoted list of plugin names.
  11. #
  12. # EXAMPLE:
  13. # ETHERPAD_PLUGINS="ep_codepad ep_author_neat"
  14. ARG ETHERPAD_PLUGINS="ep_adminpads2 ep_align ep_comments_page ep_headings2 ep_markdown ep_table_of_contents ep_delete_after_delay_lite"
  15. # By default, Etherpad container is built and run in "production" mode. This is
  16. # leaner (development dependencies are not installed) and runs faster (among
  17. # other things, assets are minified & compressed).
  18. ENV NODE_ENV=production
  19. # Follow the principle of least privilege: run as unprivileged user.
  20. #
  21. # Running as non-root enables running this image in platforms like OpenShift
  22. # that do not allow images running as root.
  23. RUN useradd --uid 5001 --create-home etherpad
  24. RUN mkdir /opt/etherpad-lite && chown etherpad:0 /opt/etherpad-lite
  25. USER etherpad
  26. WORKDIR /opt/etherpad-lite
  27. COPY --chown=etherpad:0 ./ ./
  28. # install node dependencies for Etherpad
  29. RUN bin/installDeps.sh && \
  30. rm -rf ~/.npm/_cacache
  31. # Install the plugins, if ETHERPAD_PLUGINS is not empty.
  32. #
  33. # Bash trick: in the for loop ${ETHERPAD_PLUGINS} is NOT quoted, in order to be
  34. # able to split at spaces.
  35. RUN for PLUGIN_NAME in ${ETHERPAD_PLUGINS}; do npm install "${PLUGIN_NAME}"; done
  36. # Copy the configuration file.
  37. COPY --chown=etherpad:0 ./settings.json.docker /opt/etherpad-lite/settings.json
  38. # Fix permissions for root group
  39. RUN chmod -R g=u .
  40. COPY --chown=etherpad:0 assets/index.css /opt/etherpad-lite/src/static/skins/colibris/
  41. COPY --chown=etherpad:0 assets/fond.jpg /opt/etherpad-lite/src/static/skins/colibris/images/
  42. COPY --chown=etherpad:0 assets/logo.png /opt/etherpad-lite/src/static/skins/colibris/images/
  43. COPY --chown=etherpad:0 assets/index.html /opt/etherpad-lite/src/templates/
  44. COPY --chown=etherpad:0 assets/index.js /opt/etherpad-lite/src/static/skins/colibris/
  45. COPY --chown=etherpad:0 assets/iframe_editor.css /opt/etherpad-lite/src/static/css/
  46. EXPOSE 9001
  47. CMD ["node", "node_modules/ep_etherpad-lite/node/server.js"]