postfix-smtp-relay/Dockerfile

53 lines
1.8 KiB
Docker
Raw Normal View History

2021-05-13 12:39:16 -06:00
#
2021-05-13 14:16:16 -06:00
# simple postfix smtp relay
2021-05-13 12:39:16 -06:00
#
FROM alpine:3.13
# standardized labels
LABEL author="Asif Bacchus <asif@bacchus.cloud>"
LABEL maintainer="Asif Bacchus <asif@bacchus.cloud>"
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.docker.cmd=""
2021-05-13 14:16:16 -06:00
LABEL org.label-schema.description="Simple postfix smtp mail relay on Alpine."
LABEL org.label-schema.url="https://git.asifbacchus.app/ab-docker/postfix-smtp-relay"
LABEL org.label-schema.usage="https://git.asifbacchus.app/ab-docker/postfix-smtp-relay"
LABEL org.label-schema.vcs-url="https://git.asifbacchus.app/ab-docker/postfix-smtp-relay.git"
2021-05-13 12:39:16 -06:00
2021-05-13 14:16:16 -06:00
# install packages and clean-up
2021-05-13 13:30:30 -06:00
RUN apk --no-cache add \
2021-05-13 12:39:16 -06:00
ca-certificates \
postfix \
bind-tools \
&& rm -f /var/cache/apk/*
EXPOSE 25
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 CMD [ "/usr/sbin/postfix", "status" ]
2021-05-13 12:39:16 -06:00
# set environment variables
ENV TZ=Etc/UTC
ENV LOCAL_HOSTNAME=""
ENV LOCAL_DOMAINNAME=""
2021-05-13 12:39:16 -06:00
ENV LOCAL_ENCRYPTION=false
ENV SMARTHOST=""
ENV SMARTHOST_PORT=587
ENV SMARTHOST_USERNAME=""
ENV SMARTHOST_PASSWORD=""
ENV SMARTHOST_ENCRYPTION="OPTIONAL"
# copy configuration snippets
COPY main.cf.insert /tmp/main.cf.insert
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
# set entrypoint and default command
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
CMD [ "/usr/sbin/postfix", "start-fg" ]
2021-05-13 12:39:16 -06:00
# set parameters, vendor, version and build-date labels
2021-05-13 14:16:16 -06:00
LABEL org.label-schema.docker.params="TZ=Etc/UTC, HOSTNAME=(container hostname), DOMAINNAME=(derived from hostname), LOCAL_ENCRYPTION=false|optional|true, SMARTHOST=..., SMARTHOST_PORT=587, SMARTHOST_USERNAME=..., SMARTHOST_PASSWORD=..., SMARTHOST_ENCRYPTION=optional|false|true"
2021-05-13 12:39:16 -06:00
LABEL org.label-schema.vendor="Alpine 3.13, Postfix 3.5.10-r0"
LABEL org.label-schema.version="0.9"
2021-05-13 12:39:16 -06:00
ARG BUILD_DATE
LABEL org.label-schema.build-date=${BUILD_DATE}