forked from libresh/docker-wordpress
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·35 lines (30 loc) · 920 Bytes
/
run.sh
File metadata and controls
executable file
·35 lines (30 loc) · 920 Bytes
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
32
33
34
35
/bin/bash -eux
if [ ! -e ./wp-content/mu-plugins/mail.php ]; then
mkdir ./wp-content/mu-plugins
cat > ./wp-content/mu-plugins/mail.php <<-EOF
<?php
/**
* Plugin Name: Configure SMTP
* Description: Awesome way to configure SMTP
* Author: Pierre Ozoux * Version: 0.1
*/
add_filter( 'wp_mail_from', function( $email ) {
return "${MAIL_USER}";
});
add_action( 'phpmailer_init', 'send_smtp_email' );
function send_smtp_email( \$phpmailer ) {
\$phpmailer->isSMTP();
\$phpmailer->SMTPAuth = true;
\$phpmailer->Host = "${MAIL_HOST}";
\$phpmailer->Port = "${MAIL_PORT}";
\$phpmailer->Username = "${MAIL_USER}";
\$phpmailer->Password = "${MAIL_PASS}";
// Encryption system to use - ssl or tls
\$phpmailer->SMTPSecure = "${MAIL_SECURITY}";
\$phpmailer->From = "${MAIL_USER}";
\$phpmailer->FromName = "WordPress Admin";
}
?>
EOF
fi
docker-entrypoint.sh php-fpm