|
FROM node:10-slim
|
|
ARG DOMAIN
|
|
ARG REVERSE_DNS
|
|
RUN apt update && apt -y install git python make g++ libcap2-bin
|
|
RUN git clone https://github.com/nodemailer/wildduck /wildduck
|
|
RUN git clone https://github.com/zone-eu/zone-mta-template /wildduck-mta
|
|
RUN git clone https://github.com/haraka/Haraka /haraka
|
|
COPY ./haraka/config /haraka/config
|
|
COPY ./wildduck/config /wildduck/config
|
|
COPY ./wildduck-mta/config /wildduck-mta/config
|
|
RUN chown node.node -R /wildduck /wildduck-mta /haraka
|
|
RUN setcap 'cap_net_bind_service=+ep' /usr/local/bin/node
|
|
USER node
|
|
WORKDIR /wildduck
|
|
RUN npm install --production
|
|
WORKDIR /wildduck-mta
|
|
RUN npm install --production
|
|
RUN npm install zonemta-wildduck -S
|
|
RUN npm install zonemta-limiter -S
|
|
WORKDIR /haraka
|
|
RUN npm install
|
|
RUN npm install haraka-plugin-wildduck -S
|
|
RUN find ../haraka/config ../wildduck/config ../wildduck-mta/config -type f -exec sed -i "s/{{DOMAIN}}/$DOMAIN/g" {} +
|
|
RUN find ../haraka/config ../wildduck/config ../wildduck-mta/config -type f -exec sed -i "s/{{REVERSE_DNS}}/$REVERSE_DNS/g" {} +
|