Files
webmail/integration/stalwart/Dockerfile
T
Linus Rath fe61bd8e88 test: let the Stalwart integration suite run against other Stalwart images
The integration server was pinned to `stalwartlabs/stalwart:v0.16`. The
image is now the `STALWART_IMAGE` build argument (same default), passed
through `docker-compose.yml` and `integration/run-tests.sh`.

Stalwart 1.0 answers Principal/query with `forbidden` unless the Sharing
setting `allowDirectoryQueries` is on, which would stop the shared-folder
specs in their setup. The account plan turns it on (0.16 has the same
setting), and `principalIdByEmail` reports such a refusal clearly instead
of failing on an undefined list.
2026-09-25 19:33:37 +02:00

33 lines
1.4 KiB
Docker

# Stalwart Mail Server with a declarative bootstrap for webmail integration
# testing.
#
# Extends the official image with stalwart-cli and an entrypoint that, on first
# container start, applies the bootstrap + account plans against the freshly
# started server. On subsequent starts the `.bootstrap-applied` marker short-
# circuits both phases and Stalwart boots straight into normal mode.
#
# NOTE: stalwart-cli is COPYed in rather than downloaded during the build. The
# binary is fetched by ./prepare-stalwart-cli.sh (run for you by the Playwright
# global-setup / integration runner). This keeps the build offline-friendly and
# avoids the base image's apt sources, which are unreachable in sandboxed CI.
# The Stalwart release under test. docker-compose.yml passes STALWART_IMAGE
# through (see run-tests.sh), e.g. a locally built 1.0 image.
ARG STALWART_IMAGE=stalwartlabs/stalwart:v0.16
FROM ${STALWART_IMAGE}
USER root
# Host-prefetched stalwart-cli matching the build architecture.
COPY stalwart-cli /usr/local/bin/stalwart-cli
RUN mkdir -p /etc/stalwart-bootstrap
COPY plan-bootstrap.ndjson /etc/stalwart-bootstrap/plan-bootstrap.ndjson
COPY plan-accounts.ndjson.tpl /etc/stalwart-bootstrap/plan-accounts.ndjson.tpl
COPY entrypoint.sh /usr/local/bin/stalwart-bootstrap-entrypoint.sh
RUN chmod +x /usr/local/bin/stalwart-cli /usr/local/bin/stalwart-bootstrap-entrypoint.sh
USER stalwart
ENTRYPOINT ["/usr/local/bin/stalwart-bootstrap-entrypoint.sh"]