You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Dockerfile 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. FROM node:latest
  2. ENV HOSTNAME=${HOSTNAME:-haraka.localdomain}
  3. ENV EMAIL=${EMAIL:-test@email.tld}
  4. ENV USE_LETSENCRYPT=${USE_LETSENCRYPT:-false}
  5. RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list && \
  6. apt-get update && apt-get upgrade -y && apt-get -t jessie-backports install -y supervisor certbot cron git && \
  7. mkdir /var/log/supervisord && \
  8. mkdir /var/run/supervisord && \
  9. groupadd -r haraka && \
  10. useradd --comment "Haraka Server User" \
  11. --home /haraka \
  12. --shell /bin/false \
  13. --gid haraka \
  14. -r \
  15. -m \
  16. haraka \
  17. && chown -R haraka:haraka /haraka
  18. COPY haraka.sh /haraka.sh
  19. COPY supervisord.conf /etc/supervisor/supervisord.conf
  20. COPY certbot-renew.sh /etc/cron.daily/certbot-renew.sh
  21. RUN chmod +x /haraka.sh /etc/cron.daily/certbot-renew.sh
  22. # Install and Haraka and it's plugins
  23. USER node
  24. ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
  25. ENV PATH=$PATH:/home/node/.npm-global/bin
  26. RUN npm -g install Haraka \
  27. && npm -g install haraka-net-utils \
  28. && npm -g install haraka-plugin-rspamd \
  29. && npm -g install https://github.com/haraka/haraka-plugin-auth-ldap.git \
  30. && npm -g install haraka-plugin-rcpt-ldap \
  31. && rm -f /home/node/.npm-global/lib/node_modules/Haraka/plugins/auth/auth_ldap.js \
  32. && rm -f /home/node/.npm-global/lib/node_modules/Haraka/plugins/rcpt_tp.ldap.js
  33. USER root
  34. RUN apt-get remove -y git && apt-get auto-remove -y && \
  35. rm -rf /var/lib/apt/lists/*
  36. # Port 80 is used for LetsEncrypt
  37. EXPOSE 25 80 587
  38. VOLUME /haraka
  39. VOLUME /etc/letsencrypt
  40. ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]