Skip to content

docs: Add minimal compose.yaml examples that demonstrate specific features#4138

Merged
casperklein merged 13 commits intomasterfrom
demo-setups
Jul 30, 2024
Merged

docs: Add minimal compose.yaml examples that demonstrate specific features#4138
casperklein merged 13 commits intomasterfrom
demo-setups

Conversation

@casperklein
Copy link
Copy Markdown
Member

@casperklein casperklein commented Jul 27, 2024

Description

NOTE: This PR description below was added by @polarathene

Add some of the self-contained compose.yaml examples that @polarathene has provided in past issues to support troubleshooting and demonstrate a feature working completely locally.

These are not intended to mirror production deployments, they sometimes take a different approach not suited for real deployments to better support quick setup

  • Using non-persistent configs instead of volumes.
  • Skipping proper DNS records, postfix security checks, and TLS when it can be avoided.
  • Often oriented to using swaks as the mail client within a container and staying within the same docker network, rather than interacting with a host mail client. Hence the original issue context for related CLI commands/information.

Our users often aren't aware that they can run DMS like this as easily. They can use multiple instances of DMS to learn how features work or troubleshoot without needing to worry about external third-party services, LetsEncrypt + real domain DNS and VPS, etc.

Reference: #4136 (comment)

Type of change

  • Improvement (non-breaking change that does improve existing functionality)

Checklist

  • I have added information about changes made in this PR to CHANGELOG.md

Copy link
Copy Markdown
Member

@polarathene polarathene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May want to decide on being consistent with the registry? ghcr.io/docker-mailserver/docker-mailserver / mailserver/docker-mailserver (implicit docker.io/ prefix)

Otherwise this is great, thanks for taking the time to follow-up so quickly with the discussion to make these easier to discover! 🎉

I've left a feedback comment for any future maintainers that might land here, should the examples grow or test suite migrate to compose 👍

Comment thread demo-setups/fetchmail-compose.yaml Outdated
Comment thread demo-setups/fetchmail-compose.yaml Outdated
Comment thread demo-setups/fetchmail-compose.yaml Outdated
Comment on lines +20 to +24
configs:
- source: dms-accounts-fetch
target: /tmp/docker-mailserver/postfix-accounts.cf
- source: fetchmail
target: /tmp/docker-mailserver/fetchmail.cf
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reference, if anyone does expand on this in future IIRC, the following info might be worth being aware of.


It's possible to split these out to separate compose.yaml files and use the Docker Compose feature include or the merge/override feature to share common configs.

Notably, you will have trouble merging YAML lists/sequences, which I think is only supported by multiple -f overrides (requires the same service name), whereas for YAML maps you can use Fragments / Extensions (YAML anchors/aliases + YAML merge << syntax).

  • That can make environment more suited to map style instead of list, since that supports both forms.
  • One notable difference over volumes with configs is that a bind mount volume will persist changes to disk whereas the configs approach here is useful for immutable init state when creating the container, but it can be modified after at runtime.
    • Re-creating the container will start with the initial config in compose.yaml again. This is the main value besides self-containing the example into a single file.
    • It might be possible to get the same with volumes if some of the volume driver has a setting to emulate one-way sync (:ro / read-only does but it prevents writes in the container)..

If there are separate YAML snippets to be composed, you just run docker compose config instead of the equivalent docker compose up to output the full compose.yaml. If examples grow it may be useful to know about that :)

Comment thread demo-setups/fetchmail-compose.yaml Outdated
Comment thread demo-setups/relay-compose.yaml Outdated
Comment thread demo-setups/relay-compose.yaml Outdated
Comment thread demo-setups/relay-compose.yaml Outdated
Comment thread demo-setups/relay-compose.yaml Outdated
@polarathene polarathene added this to the v14.1.0 milestone Jul 27, 2024
@polarathene polarathene added kind/improvement Improve an existing feature, configuration file or the documentation area/documentation labels Jul 27, 2024
@polarathene polarathene changed the title Add demo setups docs: Add minimal compose.yaml examples that demonstrate specific features Jul 27, 2024
casperklein and others added 8 commits July 28, 2024 17:47
Co-authored-by: Brennan Kinney <[email protected]>
Co-authored-by: Brennan Kinney <[email protected]>
Co-authored-by: Brennan Kinney <[email protected]>
Co-authored-by: Brennan Kinney <[email protected]>
Co-authored-by: Brennan Kinney <[email protected]>
Co-authored-by: Brennan Kinney <[email protected]>
Co-authored-by: Brennan Kinney <[email protected]>
Co-authored-by: Brennan Kinney <[email protected]>
@casperklein casperklein marked this pull request as ready for review July 29, 2024 22:33
Copy link
Copy Markdown
Member

@georglauterbach georglauterbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏼 Nice addition 🚀

@casperklein casperklein merged commit 01194b7 into master Jul 30, 2024
@casperklein casperklein deleted the demo-setups branch July 30, 2024 16:57
@georglauterbach georglauterbach modified the milestones: v14.1.0, v15.0.0 Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/documentation kind/improvement Improve an existing feature, configuration file or the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants