Hi @mikefarms - welcome to the farmOS community! 
It might be worth considering a feature request to add SMTP to the canonical image.
This could either be done at the install profile level in the farmOS composer.json, or in the Composer project template composer.json. The latter might make more sense, since SMTP is not a hard dependency of farmOS itself - and is more of consideration at the hosting level (downstream) - which is precisely what that Composer project template serves to provide. This would cover basic deployments, because that template is used by the Docker image, but it would also allow advanced deployments to make the decision to remove it if they want to take a different approach (by customizing/managing the project composer.json
themselves).
@Symbioquine the commands you suggest would work, but they assume that the end-user is bind-mounting the entire /opt/drupal
directory into the container. Our development environment instructions suggest this, but for “basic” production deployments it is recommended that you only bind-mount certain subdirectories (eg: /opt/drupal/web/sites
), so that you can upgrade farmOS by pulling a new Docker image.
composer require drupal/smtp
will pull in the module and dependencies into /opt/drupal/web/modules
- but those will not be persisted after pulling a new farmOS Docker image, if you aren’t bind-mounting the whole /opt/drupal
directory.
All of this speaks to the need for better documentation and recommendations for downstream hosts/users who want to add additional modules to farmOS more broadly, I think. It is easy to drop a module tarball into a bind-mounted sites/all/modules/...
directory, but if that module has additional dependencies declared in its composer.json
file (as @mikefarms described with the SMTP module), those will not be covered. There are plenty of ways to accomplish it, but it may still be worth us thinking through and documenting the “recommended” approach(es) - since someone who is not familiar with Drupal wouldn’t know where to start, and right now the considerations are a bit tangled up with how you are deploying/hosting/managing your instance.
Currently our “Installing farmOS” documentation outlines 2 “recommended” approaches to managing the farmOS codebase:
There are two supported approaches to deploying the farmOS codebase:
- Using Docker images.
- Using packaged releases.
The third way, which is not described in the docs, is “Using Composer”, which would be the “advanced” approach. I always expected we would need to add documentation for that approach eventually, and I think that may be the “right” way to recommend that people manage additional modules they want to add to their instances.
So I think we have two tasks at hand, based on this forum topic:
- Should we consider adding the SMTP module to our Composer project template, so that it’s available by default for basic deployments?
- Create an issue for documenting “advanced” Composer-based deployments.