diff --git a/README.markdown b/README.markdown index e52b5191..db73dd9d 100644 --- a/README.markdown +++ b/README.markdown @@ -40,6 +40,11 @@ To shut down the environment, run `./gradlew stop`. - [Configure Elasticsearch ports](#configure-elasticsearch-ports) - Supports Liferay clustering OOTB +### Mail features overview + +- [Enable mail service](#enable-mail-service) +- [Configure mail service ports](#configure-mail-service-ports) + ### Webserver features overview - [Enable NGINX (HTTP)](#enable-nginx-http) @@ -256,7 +261,7 @@ lr.docker.environment.service.enabled[elasticsearch]=true #### Configure Elasticsearch ports The Elasticsearch HTTP and transport ports can be configured by the `ELASTICSEARCH_HTTP_PORT` and -the `ELASTICSEARCH_TRANSPORT_PORT` respectively in the `ports.env` file. +the `ELASTICSEARCH_TRANSPORT_PORT` environment variables respectively in the `ports.env` file. `ports.env`: @@ -265,6 +270,30 @@ ELASTICSEARCH_HTTP_PORT=9200-9209 ELASTICSEARCH_TRANSPORT_PORT=9300-9309 ``` +### Mail features + +#### Enable the mail service + +Set the `lr.docker.environment.service.enabled[mail]` property to `true` or `1` in `gradle.properties`. + +`gradle.properties`: + +```properties +lr.docker.environment.service.enabled[mail]=true +``` + +#### Configure mail service ports + +The mail service's web and SMTP ports can be configured by the `MAIL_WEB_PORT` and `MAIL_SMTP_PORT` environment variables +respectively in the `ports.env` file. + +`ports.env`: + +```dotenv +MAIL_WEB_PORT=1080 +MAIL_SMTP_PORT=1025 +``` + ### Webserver Features #### Enable NGINX (HTTP) diff --git a/compose-recipes/mail/clustering.mail.yaml b/compose-recipes/mail/clustering.mail.yaml new file mode 100644 index 00000000..6b4e75ce --- /dev/null +++ b/compose-recipes/mail/clustering.mail.yaml @@ -0,0 +1,16 @@ +services: + liferay-cluster-node: + environment: + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_POP_NUMBER3__PERIOD_HOST=localhost + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_POP_NUMBER3__PERIOD_PASSWORD= + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_POP_NUMBER3__PERIOD_PORT=110 + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_POP_NUMBER3__PERIOD_USER= + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_SMTP_PERIOD_AUTH=false + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_SMTP_PERIOD_HOST=mail + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_SMTP_PERIOD_PASSWORD= + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_SMTP_PERIOD_PORT=${MAIL_SMTP_PORT} + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_SMTP_PERIOD_STARTTLS_PERIOD_ENABLE=false + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_SMTP_PERIOD_USER=admin@liferay.com + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_STORE_PERIOD_PROTOCOL=smtp + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_TRANSPORT_PERIOD_PROTOCOL=smtp + - LIFERAY_MAIL_PERIOD_SEND_PERIOD_BLACKLIST= \ No newline at end of file diff --git a/compose-recipes/mail/liferay.mail.yaml b/compose-recipes/mail/liferay.mail.yaml new file mode 100644 index 00000000..01229fe1 --- /dev/null +++ b/compose-recipes/mail/liferay.mail.yaml @@ -0,0 +1,19 @@ +services: + liferay: + depends_on: + mail: + condition: service_healthy + environment: + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_POP_NUMBER3__PERIOD_HOST=localhost + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_POP_NUMBER3__PERIOD_PASSWORD= + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_POP_NUMBER3__PERIOD_PORT=110 + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_POP_NUMBER3__PERIOD_USER= + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_SMTP_PERIOD_AUTH=false + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_SMTP_PERIOD_HOST=mail + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_SMTP_PERIOD_PASSWORD= + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_SMTP_PERIOD_PORT=${MAIL_SMTP_PORT} + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_SMTP_PERIOD_STARTTLS_PERIOD_ENABLE=false + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_SMTP_PERIOD_USER=admin@liferay.com + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_STORE_PERIOD_PROTOCOL=smtp + - LIFERAY_MAIL_PERIOD_SESSION_PERIOD_MAIL_PERIOD_TRANSPORT_PERIOD_PROTOCOL=smtp + - LIFERAY_MAIL_PERIOD_SEND_PERIOD_BLACKLIST= \ No newline at end of file diff --git a/compose-recipes/mail/service.mail.yaml b/compose-recipes/mail/service.mail.yaml new file mode 100644 index 00000000..25f7cda7 --- /dev/null +++ b/compose-recipes/mail/service.mail.yaml @@ -0,0 +1,12 @@ +services: + mail: + container_name: ${NAMESPACE}-mail + healthcheck: + interval: 10s + retries: 10 + test: nc -z localhost 1025 || exit 1 + timeout: 5s + image: maildev/maildev + ports: + - "${MAIL_WEB_PORT}:1080" + - "${MAIL_SMTP_PORT}:1025" \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index bfeb00b1..7159ffa4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -42,6 +42,7 @@ lr.docker.environment.compose.files= lr.docker.environment.service.enabled[db2]=false lr.docker.environment.service.enabled[elasticsearch]=false lr.docker.environment.service.enabled[liferay]=true +lr.docker.environment.service.enabled[mail]=false lr.docker.environment.service.enabled[mariadb]=false lr.docker.environment.service.enabled[mysql]=false lr.docker.environment.service.enabled[postgres]=false diff --git a/ports.env b/ports.env index 3a0fc209..bd015f95 100644 --- a/ports.env +++ b/ports.env @@ -8,5 +8,8 @@ DATABASE_PORT=54321-54330 ELASTICSEARCH_HTTP_PORT=9200-9209 ELASTICSEARCH_TRANSPORT_PORT=9300-9309 +MAIL_WEB_PORT=1080 +MAIL_SMTP_PORT=1025 + WEBSERVER_HTTP_PORT=80 WEBSERVER_HTTPS_PORT=443 \ No newline at end of file