diff --git a/Stable2.0/Dockerfile b/Stable2.0/Dockerfile index d2d6522..8e99652 100644 --- a/Stable2.0/Dockerfile +++ b/Stable2.0/Dockerfile @@ -1,5 +1,22 @@ FROM debian:stable-slim -LABEL maintainer="gnilebein - " +LABEL maintainer="gnilebein - " + +# 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 ENV DEBIAN_FRONTEND=noninteractive @@ -7,7 +24,7 @@ ENV DEBIAN_FRONTEND=noninteractive # Install Rspamd RUN set -x \ && 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` \ && 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 \ @@ -26,11 +43,11 @@ COPY worker-proxy.inc /etc/rspamd/override.d/ COPY set_worker_password.sh /set_worker_password.sh COPY docker-entrypoint.sh /docker-entrypoint.sh -# Keep database and configuration persistent -VOLUME /etc/rspamd/local.d -VOLUME /etc/rspamd/override.d -VOLUME /etc/rspamd/custom -VOLUME /var/lib/rspamd +# # Keep database and configuration persistent +# VOLUME /etc/rspamd/local.d +# VOLUME /etc/rspamd/override.d +# VOLUME /etc/rspamd/custom +# VOLUME /var/lib/rspamd # Port 11334 is for web frontend # 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 # Run Rspamd -ENTRYPOINT ["bash", "-c", "/docker-entrypoint.sh"] +ENTRYPOINT ["/docker-entrypoint.sh"] STOPSIGNAL SIGTERM -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 \ \ No newline at end of file +CMD ["/usr/bin/rspamd", "-f", "-u", "_rspamd", "-g", "_rspamd"] \ No newline at end of file diff --git a/Stable2.0/docker-entrypoint.sh b/Stable2.0/docker-entrypoint.sh index e453925..59186f2 100644 --- a/Stable2.0/docker-entrypoint.sh +++ b/Stable2.0/docker-entrypoint.sh @@ -2,36 +2,36 @@ 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 -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 # These exists in UI and should not be removed touch /etc/rspamd/custom/global_mime_from_blacklist.map \ - /etc/rspamd/custom/global_rcpt_blacklist.map \ - /etc/rspamd/custom/global_smtp_from_blacklist.map \ - /etc/rspamd/custom/global_mime_from_whitelist.map \ - /etc/rspamd/custom/global_rcpt_whitelist.map \ - /etc/rspamd/custom/global_smtp_from_whitelist.map \ - /etc/rspamd/custom/bad_languages.map \ - /etc/rspamd/custom/sa-rules \ - /etc/rspamd/custom/dovecot_trusted.map \ - /etc/rspamd/custom/rspamd_trusted.map \ - /etc/rspamd/custom/mailcow_networks.map \ - /etc/rspamd/custom/ip_wl.map \ - /etc/rspamd/custom/fishy_tlds.map \ - /etc/rspamd/custom/bad_words.map \ - /etc/rspamd/custom/bad_asn.map \ - /etc/rspamd/custom/bad_words_de.map \ - /etc/rspamd/custom/bulk_header.map \ - /etc/rspamd/custom/bad_header.map + /etc/rspamd/custom/global_rcpt_blacklist.map \ + /etc/rspamd/custom/global_smtp_from_blacklist.map \ + /etc/rspamd/custom/global_mime_from_whitelist.map \ + /etc/rspamd/custom/global_rcpt_whitelist.map \ + /etc/rspamd/custom/global_smtp_from_whitelist.map \ + /etc/rspamd/custom/bad_languages.map \ + /etc/rspamd/custom/sa-rules \ + /etc/rspamd/custom/dovecot_trusted.map \ + /etc/rspamd/custom/rspamd_trusted.map \ + /etc/rspamd/custom/mailcow_networks.map \ + /etc/rspamd/custom/ip_wl.map \ + /etc/rspamd/custom/fishy_tlds.map \ + /etc/rspamd/custom/bad_words.map \ + /etc/rspamd/custom/bad_asn.map \ + /etc/rspamd/custom/bad_words_de.map \ + /etc/rspamd/custom/bulk_header.map \ + /etc/rspamd/custom/bad_header.map # If DQS KEY is set in mailcow.conf add Spamhaus DQS RBLs if [[ ! -z ${SPAMHAUS_DQS_KEY} ]]; then - cat < /etc/rspamd/custom/dqs-rbl.conf + cat </etc/rspamd/custom/dqs-rbl.conf # Autogenerated by mailcow. DO NOT TOUCH! spamhaus { rbl = "${SPAMHAUS_DQS_KEY}.zen.dq.spamhaus.net"; @@ -212,7 +212,7 @@ if [[ ! -z ${SPAMHAUS_DQS_KEY} ]]; then } EOF else - rm -rf /etc/rspamd/custom/dqs-rbl.conf + rm -rf /etc/rspamd/custom/dqs-rbl.conf fi exec "$@" \ No newline at end of file