-
Notifications
You must be signed in to change notification settings - Fork 38
/
Dockerfile
48 lines (39 loc) · 1.39 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM ubuntu:14.04
MAINTAINER Lyle Scott, III "[email protected]"
ENV DEBIAN_FRONTEND noninteractive
USER root
RUN apt-get update && \
#>> Postfix setup
apt-get -q -y install \
postfix \
mailutils \
libsasl2-2 \
ca-certificates \
libsasl2-modules && \
# main.cf
postconf -e smtpd_banner="\$myhostname ESMTP" && \
postconf -e relayhost=[smtp.gmail.com]:587 && \
postconf -e smtp_sasl_auth_enable=yes && \
postconf -e smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd && \
postconf -e smtp_sasl_security_options=noanonymous && \
postconf -e smtp_tls_CAfile=/etc/postfix/cacert.pem && \
postconf -e smtp_use_tls=yes && \
#>> Setup syslog-ng to echo postfix log data to the screen
apt-get install -q -y \
syslog-ng \
syslog-ng-core && \
# system() can't be used since Docker doesn't allow access to /proc/kmsg.
# https://groups.google.com/forum/#!topic/docker-user/446yoB0Vx6w
sed -i -E 's/^(\s*)system\(\);/\1unix-stream("\/dev\/log");/' /etc/syslog-ng/syslog-ng.conf && \
# https://github.com/LyleScott/docker-postfix-gmail-relay/issues/1
sed -i '/^smtp_tls_CAfile =/d' /etc/postfix/main.cf && \
apt-get install -q -y \
supervisor
COPY supervisord.conf /etc/supervisor/
COPY init.sh /opt/init.sh
#>> Cleanup
RUN rm -rf /var/lib/apt/lists/* /tmp/* && \
apt-get autoremove -y && \
apt-get autoclean
EXPOSE 25
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]