Browse Source

Upgrade container to alpine 3.15 with no monit

master
Fábio Kaiser Rauber 3 years ago
parent
commit
eb8a86d2df
  1. 0
      .gitignore
  2. 13
      Dockerfile
  3. 1
      conf/main.cf
  4. 1
      conf/master.cf
  5. 0
      conf/outclean_header_filter
  6. 6
      conf/postfix-service.sh
  7. 8
      docker-compose.yml
  8. 4
      monit-service.conf

0
.gitignore

13
Dockerfile

@ -1,13 +1,14 @@
FROM rawmind/alpine-monit:5.25-3 FROM alpine:3.15
MAINTAINER Fabio Rauber <fabiorauber@gmail.com> LABEL MAINTAINER="Fabio Rauber <fabiorauber@gmail.com>"
RUN apk add --no-cache bash postfix postfix-pcre rsyslog RUN apk add --no-cache bash postfix postfix-pcre
COPY conf /etc/postfix COPY conf /etc/postfix
COPY rsyslog.conf /etc/rsyslog.conf
COPY monit-service.conf /opt/monit/etc/conf.d
VOLUME ["/var/spool/postfix"] VOLUME ["/var/spool/postfix"]
ENTRYPOINT ["etc/postfix/postfix-service.sh"]
CMD [ "start" ]
EXPOSE 25 EXPOSE 25

1
conf/main.cf

@ -55,3 +55,4 @@ smtpd_recipient_restrictions =
############### ###############
# Extra Settings # Extra Settings
############### ###############
maillog_file = /dev/stdout

1
conf/master.cf

@ -40,3 +40,4 @@ discard unix - - n - - discard
lmtp unix - - n - - lmtp lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil anvil unix - - n - 1 anvil
scache unix - - n - 1 scache scache unix - - n - 1 scache
postlog unix-dgram n - n - 1 postlogd

0
conf/outclean_header_filter

6
conf/postfix-service.sh

@ -38,10 +38,8 @@ function serviceStart {
serviceConf serviceConf
# Actually run Postfix # Actually run Postfix
log "[ Starting Postfix... ]" log "[ Starting Postfix... ]"
rm -f /var/run/rsyslogd.pid nohup /usr/sbin/postfix start-fg &
nohup /usr/lib/postfix/master &
echo $! > /var/run/postfix.pid echo $! > /var/run/postfix.pid
nohup rsyslogd -n &
} }
function serviceStop { function serviceStop {
@ -53,10 +51,10 @@ function serviceRestart {
log "[ Restarting Postfix... ]" log "[ Restarting Postfix... ]"
serviceStop serviceStop
serviceStart serviceStart
/opt/monit/bin/monit reload
} }
export DOMAIN=${DOMAIN:-"localhost"} export DOMAIN=${DOMAIN:-"localhost"}
export HOSTNAME=${HOSTNAME:-"localhost"}
export MESSAGE_SIZE_LIMIT=${MESSAGE_SIZE_LIMIT:-"50000000"} export MESSAGE_SIZE_LIMIT=${MESSAGE_SIZE_LIMIT:-"50000000"}
export RELAYNETS=${RELAYNETS:-""} export RELAYNETS=${RELAYNETS:-""}
export RELAYHOST=${RELAYHOST:-""} export RELAYHOST=${RELAYHOST:-""}

8
docker-compose.yml

@ -0,0 +1,8 @@
version: '2'
services:
postfix:
build: .
ports:
- 25
entrypoint: /bin/bash
tty: true

4
monit-service.conf

@ -1,4 +0,0 @@
check process master with pidfile /var/run/postfix.pid
start program = "/etc/postfix/postfix-service.sh start"
stop program = "/etc/postfix/postfix-service.sh stop"
if failed port 25 type tcp for 5 cycles then exec "/opt/monit/bin/monit quit"
Loading…
Cancel
Save