Install the proper rspamd modules on top of Alpine

master
kaiyou 7 years ago
parent ac0c339aa8
commit 3675fdb915

@ -1,9 +1,10 @@
FROM alpine:edge
RUN apk add --no-cache rspamd ca-certificates
RUN apk add --no-cache python py-jinja2 rspamd rspamd-controller rspamd-proxy ca-certificates
RUN mkdir /run/rspamd
COPY conf/ /etc/rspamd
COPY conf/ /conf
COPY start.py /start.py
CMD ["rspamd", "-i", "-f"]
CMD /start.py

@ -1,11 +0,0 @@
worker {
bind_socket = "*:11334";
type = "controller";
count = 1;
password = "mailu";
secure_ip = "127.0.0.1";
secure_ip = "::1";
static_dir = "${WWWDIR}";
.include(try=true; priority=1) "$LOCAL_CONFDIR/local.d/worker-controller.inc"
.include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-controller.inc"
}

@ -0,0 +1,3 @@
bind_socket = "*:11334";
password = "mailu";
secure_ip = "{{ FRONT_ADDRESS }}";

@ -1,5 +0,0 @@
worker "rspamd_proxy" {
bind_socket = "*:11332";
.include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/worker-proxy.inc"
.include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-proxy.inc"
}

@ -1,7 +1,4 @@
bind_socket = "*:11332";
type = "proxy";
milter = yes;
timeout = 120s;
upstream "local" {
default = yes;
self_scan = yes;

@ -0,0 +1,17 @@
#!/usr/bin/python
import jinja2
import os
import socket
import glob
convert = lambda src, dst: open(dst, "w").write(jinja2.Template(open(src).read()).render(**os.environ))
# Actual startup script
os.environ["FRONT_ADDRESS"] = socket.gethostbyname("front")
for rspamd_file in glob.glob("/conf/*"):
convert(rspamd_file, os.path.join("/etc/rspamd/local.d", os.path.basename(rspamd_file)))
# Run rspamd
os.execv("/usr/sbin/rspamd", ["rspamd", "-i", "-f"])
Loading…
Cancel
Save