refactor: move hostname detection to entrypoint

This commit is contained in:
Asif Bacchus 2021-05-13 14:04:29 -06:00
parent e17624864c
commit 720d110135
2 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ RUN apk --no-cache add \
# set environment variables # set environment variables
ENV TZ=Etc/UTC ENV TZ=Etc/UTC
ENV LOCAL_HOSTNAME=${HOSTNAME} ENV LOCAL_HOSTNAME=""
ENV LOCAL_DOMAINNAME="" ENV LOCAL_DOMAINNAME=""
ENV LOCAL_ENCRYPTION=false ENV LOCAL_ENCRYPTION=false
ENV SMARTHOST="" ENV SMARTHOST=""

View File

@ -33,7 +33,7 @@ else
# set failsafes # set failsafes
[ -z "$SMARTHOST_PORT" ] && SMARTHOST_PORT=587 [ -z "$SMARTHOST_PORT" ] && SMARTHOST_PORT=587
[ -z "$LOCAL_HOSTNAME" ] && LOCAL_HOSTNAME="smarthost" [ -z "$LOCAL_HOSTNAME" ] && LOCAL_HOSTNAME="$(uname -n)"
[ -z "$LOCAL_DOMAINNAME" ] && LOCAL_DOMAINNAME="${LOCAL_HOSTNAME#*.}" [ -z "$LOCAL_DOMAINNAME" ] && LOCAL_DOMAINNAME="${LOCAL_HOSTNAME#*.}"
printf "done\n" printf "done\n"