-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM alpine:3.20 | ||
ENV DOCKERIZE_VERSION v0.7.0 | ||
|
||
# install packages | ||
RUN apk add --no-cache --update postfix bash && \ | ||
apk add --no-cache --upgrade musl musl-utils && \ | ||
(rm "/tmp/"* 2>/dev/null || true) && (rm -rf /var/cache/apk/* 2>/dev/null || true) | ||
|
||
# install dockerize | ||
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ | ||
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ | ||
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz | ||
|
||
# copy postfix config file template into image | ||
COPY main.cf.tmpl /etc/postfix/main.cf.tmpl | ||
|
||
# copy entrypoint script into an image | ||
COPY docker-entrypoint.sh / | ||
|
||
# postfix is listening on port 25 | ||
EXPOSE 25 | ||
STOPSIGNAL SIGKILL | ||
|
||
CMD /docker-entrypoint.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# postfix | ||
|
||
Started with guide at https://www.iops.tech/blog/postfix-in-alpine-docker-container/ | ||
|
||
``` | ||
Rebuild count: 0 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#/usr/bin/env bash | ||
|
||
set -eou pipefail | ||
|
||
dockerize -template /etc/postfix/main.cf.tmpl:/etc/postfix/main.cf postfix start-fg | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
maillog_file = /dev/stdout | ||
smtp_helo_name = {{ .Env.POSTFIX_SMTP_HELO_NAME }} | ||
myorigin = {{ .Env.POSTFIX_MYORIGIN }} | ||
|
||
smtpd_banner = $myhostname ESMTP | ||
biff = no | ||
append_dot_mydomain = no | ||
readme_directory = no | ||
|
||
compatibility_level = 2 | ||
|
||
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache | ||
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache | ||
|
||
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination | ||
myhostname = {{ .Env.POSTFIX_MYHOSTNAME }} | ||
alias_maps = hash:/etc/aliases | ||
alias_database = hash:/etc/aliases | ||
mydestination = localhost.localdomain, localhost | ||
relayhost = | ||
mynetworks = 127.0.0.0/8 192.168.0.0/16 172.16.0.0/12 | ||
mailbox_size_limit = 0 | ||
recipient_delimiter = + | ||
inet_interfaces = all | ||
inet_protocols = ipv4 | ||
|