Browse Source

Initial import

master
parent
commit
4d795224ae
4 changed files with 74 additions and 0 deletions
  1. 38
    0
      Dockerfile
  2. 3
    0
      cron.sh
  3. 11
    0
      haraka.sh
  4. 22
    0
      supervisord.conf

+ 38
- 0
Dockerfile View File

@@ -0,0 +1,38 @@
FROM node:latest

ENV HOSTNAME=${HOSTNAME:-haraka}

RUN apt-get update && apt-get upgrade -y && apt-get install -y supervisor certbot && \
rm -rf /var/lib/apt/lists/* && \
mkdir /var/log/supervisord && \
groupadd -r haraka && \
useradd --comment "Haraka Server User" \
--home /haraka \
--shell /bin/false \
--gid haraka \
-r \
-m \
haraka \
&& chown -R haraka:haraka /haraka

COPY cron.sh /cron.sh
COPY haraka.sh /run.sh
COPY supervisord.conf /etc/supervisor/supervisord.conf

RUN chmod +x /cron.sh /haraka.sh

# Install and Haraka and it's plugins
USER node
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH=$PATH:/home/node/.npm-global/bin

RUN npm -g install Haraka \
&& npm -g install haraka-plugin-rspamd


# Port 80 is used for LetsEncrypt
EXPOSE 25 80 587

VOLUME /haraka

ENTRYPOINT ["/run.sh"]

+ 3
- 0
cron.sh View File

@@ -0,0 +1,3 @@
set -eu

crond -m off

+ 11
- 0
haraka.sh View File

@@ -0,0 +1,11 @@
#!/bin/bash

# Generate config
if [ ! -f /haraka/config/smtp.ini ]; then
haraka -i /haraka
fi

# Specify hostname
echo $HOSTNAME > /haraka/config/me

haraka -c /haraka

+ 22
- 0
supervisord.conf View File

@@ -0,0 +1,22 @@
[supervisord]
nodaemon=true
logfile=/var/log/supervisord/supervisord.log
pidfile=/var/run/supervisord/supervisord.pid
childlogdir=/var/log/supervisord/
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error

[program:haraka]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=/haraka.sh

[program:cron]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=/cron.sh

Loading…
Cancel
Save