Update dovecot-solr.md

This commit is contained in:
Brennan Kinney 2024-06-18 15:29:19 +12:00 committed by GitHub
parent 0af3ba2708
commit 42602339f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 35 additions and 32 deletions

View File

@ -20,39 +20,42 @@ An FTS backend supported by Dovecot is [Apache Solr][github-solr], a fast and ef
As the official DMS image does not provide `dovecot-solr`, you'll need to include the package in your own image (_extending a DMS release as a base image_), or via our [`user-patches.sh` feature][docs::user-patches]:
=== "`user-patches.sh`"
<!-- This empty quote block is purely for a visual border -->
!!! quote ""
If you'd prefer to avoid a custom image build. This approach is simpler but with the caveat that any time the container is restarted, you'll have a delay as the package is installed each time.
```bash
#!/bin/bash
apt-get update && apt-get install dovecot-solr
```
=== "`compose.yaml`"
A custom DMS image does not add much friction. You do not need a separate `Dockerfile` as Docker Compose supports building from an inline `Dockerfile` in your `compose.yaml`.
The `image` key of the service is swapped for the `build` key instead, as shown below:
```yaml
services:
mailserver:
hostname: mail.example.com
# Do not use `image` anymore, unless referring to the tagged image build below
# Add this `build` section to your real `compose.yaml` for your DMS service:
build:
tags:
- local/dms:14.0
dockerfile_inline: |
FROM docker.io/mailserver/docker-mailserver:14.0
RUN apt-get update && apt-get install dovecot-solr
```
- Just run `docker compose up` and it will pull DMS and build your custom image to run a container.
- Updating to a new DMS release is straight-forward, just adjust the version tag as you normally would. If you make future changes that don't apply, you may need to force a rebuild.
- This approach only needs to install the package once with the image build itself. This minimizes delay of container startup.
=== "`user-patches.sh`"
If you'd prefer to avoid a custom image build. This approach is simpler but with the caveat that any time the container is restarted, you'll have a delay as the package is installed each time.
```bash
#!/bin/bash
apt-get update && apt-get install dovecot-solr
```
=== "`compose.yaml`"
A custom DMS image does not add much friction. You do not need a separate `Dockerfile` as Docker Compose supports building from an inline `Dockerfile` in your `compose.yaml`.
The `image` key of the service is swapped for the `build` key instead, as shown below:
```yaml
services:
mailserver:
hostname: mail.example.com
# Do not use `image` anymore, unless referring to the tagged image build below
# Add this `build` section to your real `compose.yaml` for your DMS service:
build:
tags:
- local/dms:14.0
dockerfile_inline: |
FROM docker.io/mailserver/docker-mailserver:14.0
RUN apt-get update && apt-get install dovecot-solr
```
- Just run `docker compose up` and it will pull DMS and build your custom image to run a container.
- Updating to a new DMS release is straight-forward, just adjust the version tag as you normally would. If you make future changes that don't apply, you may need to force a rebuild.
- This approach only needs to install the package once with the image build itself. This minimizes delay of container startup.
!!! note "Why doesn't DMS include `dovecot-solr`?"