FROM debian:stable-slim # Install Postfix and tools RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y \ postfix \ postfix-mysql \ libsasl2-modules \ mailutils \ gettext-base \ netcat-openbsd \ && apt-get clean && rm -rf /var/lib/apt/lists/* # Copy configs COPY main.cf.template /etc/postfix/main.cf.template COPY sasl_passwd.template /etc/postfix/sasl_passwd.template COPY mysql_virtual_alias_maps.cf /etc/postfix/mysql_virtual_alias_maps.cf.template COPY sender_access /etc/postfix/sender_access COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh # Generate Postfix maps for sender access RUN postmap /etc/postfix/sender_access # Expose SMTP EXPOSE 25 ENTRYPOINT ["/entrypoint.sh"]