Remove VOlumes

Signed-off-by: Patrick Niebeling <patrick.niebeling@adacor.com>
This commit is contained in:
Patrick Niebeling
2024-11-06 22:08:21 +01:00
parent c4aed2f96c
commit 6b6b65d28e
2 changed files with 47 additions and 47 deletions

View File

@ -1,5 +1,22 @@
FROM debian:stable-slim FROM debian:stable-slim
LABEL maintainer="gnilebein - <docker@gnilebein.nl>" LABEL maintainer="gnilebein - <patrick@niebel.ing>"
# Setup Labels
ARG VERSION
ARG COMMIT
ARG BRANCH
ARG DATE
LABEL org.label-schema.name="Rspamd" \
org.label-schema.description="Rspamd Spam Filter - STABLE" \
org.label-schema.usage="https://hub.docker.com/r/gnilebein/rspamd/" \
org.label-schema.url="https://rspamd.com" \
org.label-schema.vendor="gnilebein" \
org.label-schema.schema-version="1.0" \
org.label-schema.version=$VERSION \
org.label-schema.vcs-url="https://github.com/rspamd/rspamd/" \
org.label-schema.vcs-ref=$COMMIT \
org.label-schema.build-date=$DATE
# Set apt non-interactive # Set apt non-interactive
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
@ -7,7 +24,7 @@ ENV DEBIAN_FRONTEND=noninteractive
# Install Rspamd # Install Rspamd
RUN set -x \ RUN set -x \
&& apt update \ && apt update \
&& apt --no-install-recommends install -y lsb-release wget gnupg openssl ca-certificates nano less \ && apt --no-install-recommends install -y apt-transport-https dnsutils netcat-traditional lsb-release wget gnupg openssl ca-certificates nano less \
&& DEBIAN_CODE_NAME=`lsb_release -c -s` \ && DEBIAN_CODE_NAME=`lsb_release -c -s` \
&& wget -O - https://rspamd.com/apt-stable/gpg.key | apt-key add - \ && wget -O - https://rspamd.com/apt-stable/gpg.key | apt-key add - \
&& echo "deb http://rspamd.com/apt-stable/ $DEBIAN_CODE_NAME main" > /etc/apt/sources.list.d/rspamd.list \ && echo "deb http://rspamd.com/apt-stable/ $DEBIAN_CODE_NAME main" > /etc/apt/sources.list.d/rspamd.list \
@ -26,11 +43,11 @@ COPY worker-proxy.inc /etc/rspamd/override.d/
COPY set_worker_password.sh /set_worker_password.sh COPY set_worker_password.sh /set_worker_password.sh
COPY docker-entrypoint.sh /docker-entrypoint.sh COPY docker-entrypoint.sh /docker-entrypoint.sh
# Keep database and configuration persistent # # Keep database and configuration persistent
VOLUME /etc/rspamd/local.d # VOLUME /etc/rspamd/local.d
VOLUME /etc/rspamd/override.d # VOLUME /etc/rspamd/override.d
VOLUME /etc/rspamd/custom # VOLUME /etc/rspamd/custom
VOLUME /var/lib/rspamd # VOLUME /var/lib/rspamd
# Port 11334 is for web frontend # Port 11334 is for web frontend
# Port 11332 is for milter # Port 11332 is for milter
@ -42,25 +59,8 @@ HEALTHCHECK --interval=1m --timeout=5s --start-period=10s \
CMD /usr/bin/rspamadm control stat || exit 1 CMD /usr/bin/rspamadm control stat || exit 1
# Run Rspamd # Run Rspamd
ENTRYPOINT ["bash", "-c", "/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]
STOPSIGNAL SIGTERM STOPSIGNAL SIGTERM
CMD ["/usr/bin/rspamd", "-f", "-u", "_rspamd", "-g", "_rspamd"] CMD ["/usr/bin/rspamd", "-f", "-u", "_rspamd", "-g", "_rspamd"]
# Setup Labels
ARG VERSION
ARG COMMIT
ARG BRANCH
ARG DATE
LABEL org.label-schema.name="Rspamd" \
org.label-schema.description="Rspamd Spam Filter - STABLE" \
org.label-schema.usage="https://hub.docker.com/r/gnilebein/rspamd/" \
org.label-schema.url="https://rspamd.com" \
org.label-schema.vendor="gnilebein" \
org.label-schema.schema-version="1.0" \
org.label-schema.version=$VERSION \
org.label-schema.vcs-url="https://github.com/rspamd/rspamd/" \
org.label-schema.vcs-ref=$COMMIT \
org.label-schema.build-date=$DATE \

View File

@ -2,36 +2,36 @@
chmod 755 /var/lib/rspamd chmod 755 /var/lib/rspamd
[[ ! -f /etc/rspamd/override.d/worker-controller-password.inc ]] && echo '# Autogenerated' > /etc/rspamd/override.d/worker-controller-password.inc [[ ! -f /etc/rspamd/override.d/worker-controller-password.inc ]] && echo '# Autogenerated' >/etc/rspamd/override.d/worker-controller-password.inc
mkdir -p /etc/rspamd/custom mkdir -p /etc/rspamd/custom
chown -R _rspamd:_rspamd /var/lib/rspamd /etc/rspamd/ chown -R _rspamd:_rspamd /var/lib/rspamd /etc/rspamd/
# Fix missing default global maps, if any # Fix missing default global maps, if any
# These exists in UI and should not be removed # These exists in UI and should not be removed
touch /etc/rspamd/custom/global_mime_from_blacklist.map \ touch /etc/rspamd/custom/global_mime_from_blacklist.map \
/etc/rspamd/custom/global_rcpt_blacklist.map \ /etc/rspamd/custom/global_rcpt_blacklist.map \
/etc/rspamd/custom/global_smtp_from_blacklist.map \ /etc/rspamd/custom/global_smtp_from_blacklist.map \
/etc/rspamd/custom/global_mime_from_whitelist.map \ /etc/rspamd/custom/global_mime_from_whitelist.map \
/etc/rspamd/custom/global_rcpt_whitelist.map \ /etc/rspamd/custom/global_rcpt_whitelist.map \
/etc/rspamd/custom/global_smtp_from_whitelist.map \ /etc/rspamd/custom/global_smtp_from_whitelist.map \
/etc/rspamd/custom/bad_languages.map \ /etc/rspamd/custom/bad_languages.map \
/etc/rspamd/custom/sa-rules \ /etc/rspamd/custom/sa-rules \
/etc/rspamd/custom/dovecot_trusted.map \ /etc/rspamd/custom/dovecot_trusted.map \
/etc/rspamd/custom/rspamd_trusted.map \ /etc/rspamd/custom/rspamd_trusted.map \
/etc/rspamd/custom/mailcow_networks.map \ /etc/rspamd/custom/mailcow_networks.map \
/etc/rspamd/custom/ip_wl.map \ /etc/rspamd/custom/ip_wl.map \
/etc/rspamd/custom/fishy_tlds.map \ /etc/rspamd/custom/fishy_tlds.map \
/etc/rspamd/custom/bad_words.map \ /etc/rspamd/custom/bad_words.map \
/etc/rspamd/custom/bad_asn.map \ /etc/rspamd/custom/bad_asn.map \
/etc/rspamd/custom/bad_words_de.map \ /etc/rspamd/custom/bad_words_de.map \
/etc/rspamd/custom/bulk_header.map \ /etc/rspamd/custom/bulk_header.map \
/etc/rspamd/custom/bad_header.map /etc/rspamd/custom/bad_header.map
# If DQS KEY is set in mailcow.conf add Spamhaus DQS RBLs # If DQS KEY is set in mailcow.conf add Spamhaus DQS RBLs
if [[ ! -z ${SPAMHAUS_DQS_KEY} ]]; then if [[ ! -z ${SPAMHAUS_DQS_KEY} ]]; then
cat <<EOF > /etc/rspamd/custom/dqs-rbl.conf cat <<EOF >/etc/rspamd/custom/dqs-rbl.conf
# Autogenerated by mailcow. DO NOT TOUCH! # Autogenerated by mailcow. DO NOT TOUCH!
spamhaus { spamhaus {
rbl = "${SPAMHAUS_DQS_KEY}.zen.dq.spamhaus.net"; rbl = "${SPAMHAUS_DQS_KEY}.zen.dq.spamhaus.net";
@ -212,7 +212,7 @@ if [[ ! -z ${SPAMHAUS_DQS_KEY} ]]; then
} }
EOF EOF
else else
rm -rf /etc/rspamd/custom/dqs-rbl.conf rm -rf /etc/rspamd/custom/dqs-rbl.conf
fi fi
exec "$@" exec "$@"