From 328fe8d03d6233014bf3bde6b3db19a813fa45c6 Mon Sep 17 00:00:00 2001 From: Fabio Rauber Date: Tue, 12 Jul 2022 14:46:39 -0300 Subject: [PATCH] Run as rspamd user and fix startup --- Dockerfile | 6 ++++++ start.sh | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 22cf3fd..6534535 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,15 @@ FROM alpine:3.16 +RUN addgroup -g 2000 rspamd && adduser -u 2000 -G rspamd -h /var/lib/rspamd -D -s /sbin/nologin rspamd + RUN apk add --no-cache rspamd rspamd-controller rspamd-proxy rspamd-fuzzy ca-certificates curl RUN mkdir /run/rspamd +RUN echo 'type = "console";' > /etc/rspamd/override.d/logging.inc \ + && echo 'bind_socket = "*:11334";' > /etc/rspamd/override.d/worker-controller.inc \ + && echo 'pidfile = false;' > /etc/rspamd/override.d/options.inc + COPY start.sh / EXPOSE 11332/tcp 11334/tcp 11335/tcp diff --git a/start.sh b/start.sh index 9fed1b8..cfad74c 100755 --- a/start.sh +++ b/start.sh @@ -10,6 +10,5 @@ password = "${PASSWORD}"; enable_password = "${PASSWORD}"; EOF - -rspamd -i +rspamd -f -u rspamd -g rspamd ln -sf /proc/1/fd/1 /var/log/rspamd/rspamd.log