forked from Neomediatech/rspamd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (28 loc) · 1.53 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
FROM neomediatech/ubuntu-base:20.04
ENV VERSION=3.2-1~focal \
SERVICE=rspamd
LABEL maintainer="docker-dario@neomediatech.it" \
org.label-schema.version=$VERSION \
org.label-schema.vcs-type=Git \
org.label-schema.vcs-url=https://github.com/Neomediatech/${SERVICE} \
org.label-schema.maintainer=Neomediatech
RUN apt-get update && apt-get -y dist-upgrade && \
apt-get install -y --no-install-recommends \
ca-certificates lsb-release wget gnupg && \
CODENAME=`lsb_release -c -s` && \
wget -O- https://rspamd.com/apt-stable/gpg.key | apt-key add - && \
echo "deb [arch=amd64] http://rspamd.com/apt-stable/ $CODENAME main" > /etc/apt/sources.list.d/rspamd.list && \
echo "deb-src [arch=amd64] http://rspamd.com/apt-stable/ $CODENAME main" >> /etc/apt/sources.list.d/rspamd.list && \
apt-get update && \
apt-get --no-install-recommends install -y rspamd && \
rm -rf /var/lib/apt/lists/* && \
echo 'pidfile = false;' > /etc/rspamd/override.d/options.inc && \
mkdir -p /srv/scripts && \
wget -O /srv/scripts/logrotate.sh https://raw.githubusercontent.com/Neomediatech/assets/main/scripts/logrotate.sh && \
chmod +x /srv/scripts/logrotate.sh
COPY conf/ /etc/rspamd
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
HEALTHCHECK --interval=30s --timeout=30s --start-period=10s --retries=20 CMD rspamadm control stat |grep uptime|head -1 || ( echo "no uptime, no party\!" && exit 1 )
ENTRYPOINT ["/entrypoint.sh"]
CMD [ "/usr/bin/rspamd", "-f", "-u", "_rspamd", "-g", "_rspamd" ]