Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriipavlov committed Jul 18, 2024
2 parents 6c50681 + 7e85f34 commit 0b7f51c
Show file tree
Hide file tree
Showing 24 changed files with 168 additions and 155 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ replace:
pma:
docker compose -f docker-compose.build.yml run --service-ports --rm --build phpmyadmin

mailhog:
docker-compose -f docker-compose.build.yml run --service-ports --rm --name mailhog mailhog

log:
docker compose logs -f

Expand Down
37 changes: 32 additions & 5 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,41 @@ make docker push

## Sending emails

Docker containers do not have a custom SMTP server. We use an SMTP relay service. You can set up an SMTP server
like Gmail, AWS, Sendinblue, Mailgun, etc, or use another server you like.
Mail is not routed by the Docker containers, you must use an SMTP external service to route your site's email.

Just edit sSMTP config block in your `.env.secret` file.
The reason that mail is not routed is that configuring mail to route from the proper domain on a server is often a headache. A further headache is actually getting mail delivered from an arbitrary IP. A third issue is that mail servers consume resources. A fourth issue is security. So for all these reasons we decided not to implement mail and instead delegate that task to various providers.

sSMTP config files `./docker/wordpress/config/ssmtp.conf.template` and `./docker/wordpress/config/revaliases.template` automatically loaded into the WordPress container
You can set up an SMTP service like Gmail, AWS SES, Sendinblue, Mailgun, etc., or use another server you like.

Just edit SMTP config block in your `.env.main` and `.env.secret` files.

`.env.main`:
```bash
# SMTP config
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587

# none|ssl|tls
SMTP_SECURE=tls
SMTP_DEBUG=0
```

`.env.secret`:
```bash
SMTP_USER=your_smtp_service_user_name
SMTP_PASS=your_smtp_service_user_password
```

Also, to debug Emails on local you can use [MailHog](https://github.com/mailhog/MailHog) service. Just run:

```bash
make mailhog
```

`.env.type.local` file already has mailhog connection settings.

This will run MailHog container, and you can access it on `your-app-domain.com:8025` URL.

See [an example](https://www.wordpressdocker.com/mailgun-ssmtp/) of ssmtp.conf

## Database management
### SSH tunnel options
Expand Down
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"package": {
"name": "solidbunch/wordpress-core",
"type": "laravel-library",
"version": "6.5.4",
"version": "6.5.5",
"dist": {
"type": "zip",
"url": "https://wordpress.org/wordpress-6.5.4.zip"
"url": "https://wordpress.org/wordpress-6.5.5.zip"
}
}
},
Expand All @@ -49,10 +49,11 @@
],
"require": {
"php": ">=8.1",
"solidbunch/wordpress-core": "6.5.4",
"solidbunch/wordpress-core": "6.5.5",
"composer/installers": "2.2.0",
"solidbunch/starter-kit-theme": "dev-develop",
"wpackagist-plugin/contact-form-7":"5.9.5",
"wpackagist-plugin/contact-form-7":"5.9.6",
"wpackagist-plugin/redirection":"5.4.2",
"wpackagist-plugin/svg-support": "2.5.5"
},
"require-dev": {
Expand Down
67 changes: 45 additions & 22 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 23 additions & 5 deletions config/environment/.env.main
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ APP_BUILD_MODE=dev

# Docker containers images
# use build: ./dockerfiles/service-name in docker-compose.yml file for building just local images
APP_DATABASE_IMAGE=ghcr.io/solidbunch/starter-kit-mariadb:11.3.2-jammy
APP_PHP_IMAGE=ghcr.io/solidbunch/starter-kit-php:8.1-fpm-alpine3.19
APP_NGINX_IMAGE=ghcr.io/solidbunch/starter-kit-nginx:1.25-alpine3.18
APP_CRON_IMAGE=ghcr.io/solidbunch/starter-kit-cron:1.5-alpine3.19
APP_DATABASE_IMAGE=ghcr.io/solidbunch/starter-kit-mariadb:11.4.2-noble
APP_PHP_IMAGE=ghcr.io/solidbunch/starter-kit-php:8.1-fpm-alpine3.20
APP_NGINX_IMAGE=ghcr.io/solidbunch/starter-kit-nginx:1.27-alpine3.19
APP_CRON_IMAGE=ghcr.io/solidbunch/starter-kit-cron:1.5-alpine3.20
APP_COMPOSER_IMAGE=ghcr.io/solidbunch/starter-kit-composer:2.7
APP_NODE_IMAGE=ghcr.io/solidbunch/starter-kit-node:18-alpine3.19
APP_NODE_IMAGE=ghcr.io/solidbunch/starter-kit-node:18-alpine3.20
APP_PHPMYADMIN_IMAGE=phpmyadmin:5.2-apache
APP_MAILHOG_IMAGE=mailhog/mailhog:v1.0.1

# Server capacity
WP_MEMORY_LIMIT=256M
Expand Down Expand Up @@ -75,3 +76,20 @@ SSH_TUNNEL_EXT_PORT=33061
# WARNING Do not run phpMyAdmin on production, it's not secure
PMA_EXT_PORT=8801
PMA_ARBITRARY=0

# SMTP config
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
# SMTP_USER and SMTP_PASS defined in .env.secret

# none|ssl|tls
SMTP_SECURE=tls
SMTP_FROM=
SMTP_NAME=

# 0 No debug output, default
# 1 Client commands
# 2 Client commands and server responses
# 3 As 2 plus connection status
# 4 Low-level data output, all messages.
SMTP_DEBUG=0
1 change: 1 addition & 0 deletions config/environment/.env.type.dev
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ APP_BA_WP_LOGIN=enable
APP_WP_BACKUP_ENABLE=1

# Debug
# Debug logging already defined in php.ini
WP_DEBUG=0
WP_DEBUG_DISPLAY=0
# Debug log connected as volume to ./logs/wordpress
Expand Down
16 changes: 16 additions & 0 deletions config/environment/.env.type.local
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ APP_BA_WP_LOGIN=disable
APP_WP_BACKUP_ENABLE=1

# Debug
# Debug logging already defined in php.ini
WP_DEBUG=0
WP_DEBUG_DISPLAY=0
# Debug log connected as volume to ./logs/wordpress
Expand All @@ -62,3 +63,18 @@ PHP_INI_SCAN_DIR=/usr/local/etc/php/local.d
# /dev/stderr and /dev/stdout follows logs to docker
APP_NGINX_ERROR_LOG=/dev/stderr
APP_NGINX_ACCESS_LOG=off

# SMTP config
SMTP_HOST=mailhog
SMTP_PORT=1025
# SMTP_USER and SMTP_PASS defined in .env.secret

# none|ssl|tls
SMTP_SECURE=none

# 0 No debug output, default
# 1 Client commands
# 2 Client commands and server responses
# 3 As 2 plus connection status
# 4 Low-level data output, all messages.
SMTP_DEBUG=1
1 change: 1 addition & 0 deletions config/environment/.env.type.prod
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ APP_BA_WP_LOGIN=enable
APP_WP_BACKUP_ENABLE=1

# Debug
# Debug logging already defined in php.ini
WP_DEBUG=0
WP_DEBUG_DISPLAY=0
# Debug log connected as volume to ./logs/wordpress
Expand Down
1 change: 1 addition & 0 deletions config/environment/.env.type.stage
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ APP_BA_WP_LOGIN=enable
APP_WP_BACKUP_ENABLE=1

# Debug
# Debug logging already defined in php.ini
WP_DEBUG=0
WP_DEBUG_DISPLAY=0
# Debug log connected as volume to ./logs/wordpress
Expand Down
2 changes: 1 addition & 1 deletion config/php/php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ pdo_mysql.default_socket=

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; https://php.net/sendmail-path
sendmail_path = /usr/sbin/ssmtp -t -i
;sendmail_path =

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
Expand Down
8 changes: 0 additions & 8 deletions config/ssmtp/revaliases.template

This file was deleted.

Loading

0 comments on commit 0b7f51c

Please sign in to comment.