mirror of
https://github.com/bokysan/docker-postfix.git
synced 2025-09-06 06:25:40 +08:00
Postfix, initial release
This commit is contained in:
commit
d2487b475b
4 changed files with 74 additions and 0 deletions
23
Dockerfile
Normal file
23
Dockerfile
Normal file
|
@ -0,0 +1,23 @@
|
|||
FROM alpine:edge
|
||||
MAINTAINER Bojan Cekrlic
|
||||
|
||||
# You can set this variables when running the image to override the host name or
|
||||
# foward the messages to another server
|
||||
#ENV HOSTNAME
|
||||
#ENV RELAYHOST
|
||||
|
||||
RUN true && \
|
||||
apk add --no-cache --update postfix ca-certificates supervisor rsyslog bash && \
|
||||
(rm "/tmp/"* 2>/dev/null || true) && (rm -rf /var/cache/apk/* 2>/dev/null || true)
|
||||
|
||||
COPY supervisord.conf /etc/supervisord.conf
|
||||
COPY rsyslog.conf /etc/rsyslog.conf
|
||||
COPY postfix.sh /postfix.sh
|
||||
RUN chmod +x /postfix.sh
|
||||
|
||||
VOLUME [ "/var/spool/postfix" ]
|
||||
|
||||
USER root
|
||||
WORKDIR /tmp
|
||||
ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
|
||||
|
15
postfix.sh
Normal file
15
postfix.sh
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [[ ! -z "$HOSTNAME" ]]; then
|
||||
postconf -e myhostname=$HOSTNAME
|
||||
else
|
||||
postconf -# myhostname
|
||||
fi
|
||||
|
||||
if [[ ! -z "$RELAYHOST" ]]; then
|
||||
postconf -e relayhost=$RELAYHOST
|
||||
else
|
||||
postconf -# relayhost
|
||||
fi
|
||||
|
||||
/usr/sbin/postfix -c /etc/postfix start
|
14
rsyslog.conf
Normal file
14
rsyslog.conf
Normal file
|
@ -0,0 +1,14 @@
|
|||
$ModLoad immark.so # provides --MARK-- message capability
|
||||
$ModLoad imuxsock.so # provides support for local system logging (e.g. via logger command)
|
||||
|
||||
# default permissions for all log files.
|
||||
$FileOwner root
|
||||
$FileGroup adm
|
||||
$FileCreateMode 0640
|
||||
$DirCreateMode 0755
|
||||
$Umask 0022
|
||||
|
||||
#*.info /dev/stdout
|
||||
#mail.* /dev/stdout
|
||||
mail.info /dev/stdout
|
||||
|
22
supervisord.conf
Normal file
22
supervisord.conf
Normal file
|
@ -0,0 +1,22 @@
|
|||
[supervisord]
|
||||
nodaemon = true
|
||||
logfile = /dev/null
|
||||
logfile_maxbytes= 0
|
||||
|
||||
[program:rsyslog]
|
||||
command = rsyslogd -n
|
||||
autostart = true
|
||||
autorestart = true
|
||||
startsecs = 2
|
||||
stopwaitsecs = 2
|
||||
stdout_logfile = /dev/stdout
|
||||
stderr_logfile = /dev/stderr
|
||||
stdout_logfile_maxbytes = 0
|
||||
stderr_logfile_maxbytes = 0
|
||||
|
||||
[program:postfix]
|
||||
process_name = master
|
||||
directory = /etc/postfix
|
||||
command = /postfix.sh
|
||||
startsecs = 0
|
||||
autorestart = false
|
Loading…
Add table
Reference in a new issue