forked from vshalts/docker-emailrelay
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
31 lines (25 loc) · 1.09 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
FROM alpine:latest
LABEL maintainer="Aleksei Zhukov <[email protected]>"
RUN echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
&& apk add --no-cache libstdc++ openssl ca-certificates dumb-init swaks@testing perl-net-ssleay \
&& update-ca-certificates
ARG DOWNLOAD_URL=https://downloads.sourceforge.net/project/emailrelay/emailrelay/1.9/emailrelay-1.9-src.tar.gz
RUN apk add --no-cache --virtual .deps curl g++ make autoconf automake openssl-dev \
&& mkdir -p /tmp/build && cd /tmp/build \
&& curl -o emailrelay.tar.gz -L "${DOWNLOAD_URL}" \
&& tar xzf emailrelay.tar.gz \
&& cd emailrelay-1.9 \
&& ./configure --prefix=/usr --with-openssl \
&& make \
&& make install \
&& apk --no-cache del .deps \
&& cd / \
&& rm -rf /tmp/build /var/tmp/* /var/cache/apk/* /var/cache/distfiles/* \
&& mkdir -p /var/spool/emailrelay
ENV PORT=587
COPY run.sh /run.sh
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/run.sh"]
CMD []
ENV SWAKS_OPTS="-tls"
HEALTHCHECK --interval=2m --timeout=5s \
CMD swaks -S -h localhost -s localhost:${PORT:-587} -q HELO ${SWAKS_OPTS} || exit 1