add: improved workflow for caprover

This commit is contained in:
2026-03-21 10:44:21 -03:00
parent 1b14051640
commit 9a723b069d
7 changed files with 91 additions and 15 deletions
+34
View File
@@ -0,0 +1,34 @@
#!/bin/sh
set -e
echo "=== RUNTIME SETUP (start) ==="
if [ -n "${SMTP_HOST}" ]; then
echo "Configurando msmtp para ${SMTP_HOST}..."
cat > /etc/msmtprc <<EOF
defaults
auth ${SMTP_AUTH:-on}
tls ${SMTP_TLS:-on}
syslog on
account default
host ${SMTP_HOST}
port ${SMTP_PORT:-587}
from ${SMTP_FROM:-${WORDPRESS_ADMIN_EMAIL}}
user ${SMTP_USER}
password ${SMTP_PASSWORD}
EOF
chmod 600 /etc/msmtprc
# Aponta o PHP para o msmtp
printf 'sendmail_path = "/usr/bin/msmtp -t"\nmail.add_x_header = On' > /usr/local/etc/php/conf.d/99-mail.ini
else
echo "Nenhum SMTP_HOST detectado. Usando solução padrão do PHP."
rm -f /usr/local/etc/php/conf.d/99-mail.ini
fi
echo "=== RUNTIME SETUP (end) ==="
# O "pulo do gato": executa o entrypoint original da imagem do WordPress
# passando todos os argumentos (geralmente 'php-fpm')
exec docker-entrypoint.sh "$@"