]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Fix and clean up Dockerfile
authorTim Düsterhus <tim@bastelstu.be>
Thu, 22 Mar 2018 00:02:46 +0000 (01:02 +0100)
committerTim Düsterhus <tim@bastelstu.be>
Thu, 22 Mar 2018 00:05:02 +0000 (01:05 +0100)
docker/Dockerfile
docker/rspamd.conf [deleted file]
docker/rspamd.list [deleted file]

index 70133a5bc44e7290a05decd49b8ef9551a11d889..9ec9aece2eb82be6a96f85762344567b4eb73df2 100644 (file)
@@ -1,25 +1,23 @@
+FROM debian:stretch
 
-FROM debian:latest
-MAINTAINER Matt Simerson <matt@tnpi.net>
+RUN    apt-get update \
+&&     apt-get install -y --no-install-recommends gnupg dirmngr curl \
+&&     curl -fsSL http://rspamd.com/apt-stable/gpg.key | apt-key add - \
+&&     apt-get purge -y --auto-remove curl \
+&&     rm -rf /var/lib/apt/lists/*
 
-# if Debian's ancient 0.6.10 is new enough...
-#RUN apt-get update && apt-get install -y rspamd
+RUN echo "deb http://rspamd.com/apt-stable/ stretch main" > /etc/apt/sources.list.d/rspamd.list
 
-# Instead, get latest release, from the source
-COPY rspamd.list /etc/apt/sources.list.d/rspamd.list
-RUN apt-get update \
-    && apt-get install -y curl \
-    && curl -o - http://rspamd.com/apt-stable/gpg.key | apt-key add - \
-    && apt-get install -y --force-yes \
-       rspamd \
-    && apt-get clean \
-    && rm -rf /var/lib/apt/lists/*
+RUN    apt-get update \
+&&     apt-get install -y rspamd \
+&&     rm -rf /var/lib/apt/lists/*
 
-# start up rspamd once, as it does some initialization
-RUN update-rc.d rspamd defaults && service rspamd start && sleep 30
+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
 
-# Debian 8's rspamd.conf is for systemd, which is not running in container
-COPY rspamd.conf /etc/rspamd/rspamd.conf
-CMD ["/usr/bin/rspamd","-f", "-u", "_rspamd", "-g", "_rspamd"]
+VOLUME [ "/var/lib/rspamd" ]
+
+CMD    [ "/usr/bin/rspamd", "-f", "-u", "_rspamd", "-g", "_rspamd" ]
 
 EXPOSE 11333 11334
diff --git a/docker/rspamd.conf b/docker/rspamd.conf
deleted file mode 100644 (file)
index 46837de..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-.include "$CONFDIR/common.conf"
-
-options {
-    .include "$CONFDIR/options.inc"
-}
-
-logging {
-    type = "console";
-    systemd = false;
-    .include "$CONFDIR/logging.inc"
-}
-
-worker {
-    bind_socket = "*:11333";
-    .include "$CONFDIR/worker-normal.inc"
-}
-
-worker {
-    bind_socket = "localhost:11334";
-    .include "$CONFDIR/worker-controller.inc"
-}
diff --git a/docker/rspamd.list b/docker/rspamd.list
deleted file mode 100644 (file)
index 6be6b64..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-deb http://rspamd.com/apt-stable/ jessie main
-deb-src http://rspamd.com/apt-stable/ jessie main