This repository has been archived by the owner on Mar 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
77 lines (68 loc) · 2.26 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
FROM debian:latest
# timezone name that can be overridden when building the container
ARG CTNR_TZ=UTC
# shell to start from Kitematic
ENV DEBIAN_FRONTEND=noninteractive
ENV SHELL=/bin/bash
# timezone to set
ENV CTNR_TZ=${CTNR_TZ}
# install dependencies
RUN apt-get update && \
apt-get install -y \
cron \
imapfilter \
nano \
python \
python-pip \
python-setuptools \
pyzor \
razor \
rsyslog \
spamassassin \
spamc \
unzip \
wget \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
/usr/bin/env python -m pip install wheel && \
/usr/bin/env python -m pip install docopt==0.6.2
WORKDIR /root
# install isbg
RUN wget https://github.com/dc55028/isbg/archive/master.zip && \
mv master.zip isbg.zip && \
unzip isbg.zip && \
cd isbg-master && \
python setup.py install && \
cd .. && \
rm -Rf isbg-master && \
rm isbg.zip
ADD files/* /root/
# prepare directories and files
RUN mkdir /root/accounts ; \
mkdir /root/.imapfilter ; \
mkdir -p /var/spamassassin/bayesdb ; \
chown -R debian-spamd:mail /var/spamassassin ; \
chmod u+x startup ; \
chmod u+x *.sh ; \
crontab cron_scans && rm cron_scans ; \
sed -i 's/ENABLED=0/ENABLED=1/' /etc/default/spamassassin ; \
sed -i 's/CRON=0/CRON=1/' /etc/default/spamassassin ; \
sed -i 's/^OPTIONS=".*"/OPTIONS="--allow-tell --max-children 5 --helper-home-dir -u debian-spamd -x --virtual-config-dir=\/var\/spamassassin -s mail"/' /etc/default/spamassassin ; \
echo "bayes_path /var/spamassassin/bayesdb/bayes" >> /etc/spamassassin/local.cf ; \
echo "allow_user_rules 1" >> /etc/spamassassin/local.cf ; \
mv 9*.cf /etc/spamassassin/ ; \
echo "alias logger='/usr/bin/logger -e'" >> /etc/bash.bashrc ; \
echo "LANG=en_US.UTF-8" > /etc/default/locale ; \
if [ -e "/usr/share/zoneinfo/${CTNR_TZ}" ]; then \
unlink /etc/localtime ; \
ln -s "/usr/share/zoneinfo/${CTNR_TZ}" /etc/localtime ; \
unlink /etc/timezone ; \
ln -s "/usr/share/zoneinfo/${CTNR_TZ}" /etc/timezone ; \
dpkg-reconfigure -f noninteractive tzdata ; \
fi
# volumes
VOLUME /var/spamassassin
VOLUME /root/.imapfilter
VOLUME /root/accounts
CMD /root/startup && tail -n 0 -F /var/log/*.log