Merge branch 'master' into feature-swarm

This commit is contained in:
ofthesun9
2018-10-07 16:42:25 +00:00
6 changed files with 34 additions and 11 deletions

View File

@@ -1,6 +1,8 @@
FROM alpine:3.7
RUN apk add --no-cache postfix postfix-sqlite postfix-pcre rsyslog python py-jinja2
RUN apk add --no-cache postfix postfix-sqlite postfix-pcre rsyslog python py-jinja2 py-pip \
&& pip install --upgrade pip \
&& pip install tenacity
COPY conf /conf
COPY start.py /start.py

View File

@@ -5,11 +5,17 @@ import os
import socket
import glob
import shutil
import tenacity
from tenacity import retry
convert = lambda src, dst: open(dst, "w").write(jinja2.Template(open(src).read()).render(**os.environ))
@retry(stop=tenacity.stop_after_attempt(100), wait=tenacity.wait_random(min=2, max=5))
def resolve():
os.environ["FRONT_ADDRESS"] = socket.gethostbyname(os.environ.get("FRONT_ADDRESS", "front"))
# Actual startup script
os.environ["FRONT_ADDRESS"] = socket.gethostbyname(os.environ.get("FRONT_ADDRESS", "front"))
resolve()
os.environ["HOST_ANTISPAM"] = os.environ.get("HOST_ANTISPAM", "antispam:11332")
os.environ["HOST_LMTP"] = os.environ.get("HOST_LMTP", "imap:2525")