From 071aaa7fe0e02c91739ac3403261fd231545efbe Mon Sep 17 00:00:00 2001 From: Philipp Rothmann Date: Wed, 22 Mar 2023 14:59:18 +0100 Subject: [PATCH] add smtp --- .env.sample | 6 ++++-- compose.yml | 8 +++++++- entrypoint.sh | 3 ++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.env.sample b/.env.sample index 425e309..6d9daf5 100644 --- a/.env.sample +++ b/.env.sample @@ -22,8 +22,10 @@ WORDPRESS_DB_HOST=mysql WORDPRESS_DB_PORT=3306 # WORDPRESS_TABLE_PREFIX -SMTP_HOST=maildev -SMTP_MAILDOMAIN=example.org +SMTP_HOST=mail.example.org +SMTP_PORT=587 +SMTP_USER= +SECRET_SMTP_PASSWORD_VERSION=v1 PHP_DATE_TIMEZONE="UTC" diff --git a/compose.yml b/compose.yml index 8f0ffa9..d32de6b 100644 --- a/compose.yml +++ b/compose.yml @@ -19,12 +19,15 @@ services: - WORDPRESS_DB_HOST=db - WORDPRESS_DB_PORT=3306 - SMTP_HOST - - SMTP_MAILDOMAIN + - SMTP_PORT + - SMTP_USER + - SMTP_PASSWORD_FILE=/run/secrets/smtp_password secrets: - db_password - civicrm_site_key - civicrm_cred_key - civicrm_sign_key + - smtp_password volumes: - uploads:/var/www/html/wp-content/uploads # - ./.bash_history:/home/civicrm/.bash_history @@ -124,6 +127,9 @@ secrets: db_root_password: external: true name: ${STACK_NAME}_db_root_password_${SECRET_DB_ROOT_PASSWORD_VERSION} + smtp_password: + external: true + name: ${STACK_NAME}_smtp_password_${SECRET_SMTP_PASSWORD_VERSION} db_password: external: true name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION} diff --git a/entrypoint.sh b/entrypoint.sh index b3ba25c..5905dc8 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -27,6 +27,7 @@ file_env "WORDPRESS_DB_PASS" file_env "CIVICRM_DB_PASS" file_env "CIVICRM_SITE_KEY" file_env "CIVICRM_CRED_KEYS" +file_env "SMTP_PASSWORD" until mysql -e '\q' -h db -p"${WORDPRESS_DB_PASS}" && mysql -e '\q' -h db-civicrm -p"${CIVICRM_DB_PASS}"; do echo "Waiting for db container to come up" @@ -37,7 +38,7 @@ echo "=== Running Docker Entrypoint" /usr/local/bin/civicrm-docker-entrypoint echo "Installing Wordpress" -su civicrm -c "wp core install --locale=de_DE --url=$BASE_URL --title=$PROJECT_NAME --admin_user=admin --admin_email=admin@example.org" +su civicrm -c "wp core install --locale=de_DE --url=$BASE_URL --title=$PROJECT_NAME --admin_user=admin --admin_email=$SMTP_USER" su civicrm -c "wp language core install de_DE" su civicrm -c "wp language core activate de_DE"