-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
45 lines (35 loc) · 1.24 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
FROM node:10-stretch
WORKDIR /app
RUN \
apt-get -y update && \
apt-get -y upgrade && \
apt-get install -y software-properties-common redis-server spamassassin spamc python openssl python-pip curl && \
pip install pyspf pydns ipaddr dkimpy pynacl authres dnspython pydns
RUN \
openssl genrsa -out dkim-private.key 1024 && \
openssl rsa -in dkim-private.key -pubout -out dkim-public.key && \
echo "Add this to your DNS zonefile:" && \
sed '3,3!d' dkim-public.key | sed ':a;N;$!ba;s/\n//g' | xargs -I{} echo "default._domainkey 14400 IN TXT \"v=DKIM1; k=rsa; p={}\"" | tee DKIM-TXT-record
COPY package.json yarn.lock /app/
RUN yarn
COPY * /app/
EXPOSE 25
ENV IP_ADDRESS ""
ENV EXCHANGES ""
ENV SECURE "false"
ENV SSL_KEY ""
ENV SSL_KEY_FILE ""
ENV SSL_CERT ""
ENV SSL_CERT_FILE ""
ENV SSL_CA ""
ENV SSL_CA_FILE ""
ENV DKIM_PRIVATE_KEY ""
ENV DKIM_KEY_SELECTOR "default"
ENV DKIM_PRIVATE_KEY_FILE /app/dkim-private.key
CMD \
/usr/sbin/spamd -d --pidfile=/var/run/spamd.pid && \
/usr/bin/redis-server /etc/redis/redis.conf && \
/app/index.js
#docker run --network host --hostname <yourdomain.com> --name <container name> -d forward-email:latest
# Add the following line to your DNS zonefile:
#docker exec <container name> cat /app/DKIM-TXT-record