From 42954bfd2504144352897e2b178feb3ad5464f00 Mon Sep 17 00:00:00 2001 From: Carlos Mogas da Silva Date: Wed, 20 Jun 2018 16:11:02 +0100 Subject: [PATCH] Cleanup a little more --- Dockerfile | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index d4941fe..5d68ca4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,10 @@ ENV HOSTNAME=${HOSTNAME:-haraka.localdomain} ENV EMAIL=${EMAIL:-test@email.tld} ENV USE_LETSENCRYPT=${USE_LETSENCRYPT:-false} -RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list && \ +COPY haraka.sh /haraka.sh + +RUN chmod +x /haraka.sh /etc/cron.daily/certbot-renew.sh && \ + echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list && \ apt-get update && apt-get upgrade -y && apt-get -t jessie-backports install -y --no-install-recommends supervisor certbot cron git && \ mkdir /var/log/supervisord && \ mkdir /var/run/supervisord && \ @@ -18,13 +21,18 @@ RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/so haraka \ && chown -R haraka:haraka /haraka -COPY haraka.sh /haraka.sh COPY supervisord.conf /etc/supervisor/supervisord.conf COPY certbot-renew.sh /etc/cron.daily/certbot-renew.sh -RUN chmod +x /haraka.sh /etc/cron.daily/certbot-renew.sh +# Port 80 is used for LetsEncrypt +EXPOSE 25 80 587 + +VOLUME /haraka +VOLUME /etc/letsencrypt + +ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] -# Install and Haraka and it's plugins +# Install Haraka and it's plugins USER node ENV NPM_CONFIG_PREFIX=/home/node/.npm-global ENV PATH=$PATH:/home/node/.npm-global/bin @@ -35,16 +43,3 @@ RUN npm -g install \ haraka-plugin-rspamd \ haraka-plugin-rcpt-ldap \ https://github.com/haraka/haraka-plugin-auth-ldap.git - -USER root - -RUN apt-get -y autoremove git && \ - rm -rf /var/lib/apt/lists/* - -# Port 80 is used for LetsEncrypt -EXPOSE 25 80 587 - -VOLUME /haraka -VOLUME /etc/letsencrypt - -ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]