Add Docker setup with SMTP mail and logging

This commit is contained in:
2025-12-10 20:50:15 -08:00
parent c3a37187bf
commit 5ab3eb6039
4 changed files with 77 additions and 3 deletions

26
docker-entrypoint.sh Normal file
View File

@@ -0,0 +1,26 @@
#!/bin/sh
set -e
# If SMTP vars are provided, write an msmtp config for authenticated SMTP
if [ -n "${SMTP_HOST:-}" ]; then
: "${SMTP_PORT:=587}"
: "${SMTP_FROM:=noreply@example.com}"
: "${SMTP_TLS:=on}"
cat > /etc/msmtprc <<EOF
account default
host ${SMTP_HOST}
port ${SMTP_PORT}
from ${SMTP_FROM}
auth on
user ${SMTP_USER:-}
password ${SMTP_PASSWORD:-}
tls ${SMTP_TLS}
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile /var/log/msmtp.log
EOF
chmod 600 /etc/msmtprc
fi
exec docker-php-entrypoint "$@"