You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two related operator-facing docs gaps, both surfaced by #7819:
1. settings.json on disk is a *template*; env-var substitution happens
at load time in memory only. Operators repeatedly mistake the
templated file for a stale config because the docs never spell out
that the on-disk file is intentionally unchanged by env vars.
2. The default docker-compose.yml puts settings.json in the container's
writable layer with no host mount, which means admin /settings edits
are silently lost on `docker compose down && up`, `pull`, or
watchtower — but preserved across plain `restart`. Operators don't
reliably know which compose verbs recreate the container.
Adds two prose sections to doc/docker.md (explaining both gotchas, with
a recreate-vs-restart table) and a commented-out `./settings.json:…`
bind mount in both docker-compose.yml and the README compose example.
Bind mount is opt-in so existing setups behave identically.
No runtime change.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: doc/docker.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,37 @@ Edit `<BASEDIR>/settings.json.docker` at your will. When rebuilding the image, t
29
29
30
30
**Each configuration parameter can also be set via an environment variable**, using the syntax `"${ENV_VAR}"` or `"${ENV_VAR:default_value}"`. For details, refer to `settings.json.template`.
31
31
32
+
### How `settings.json` and environment variables interact
33
+
34
+
This trips people up often enough that it's worth calling out explicitly (see [#7819](https://github.com/ether/etherpad/issues/7819)):
35
+
36
+
*`settings.json` inside the container is a **template** containing `${VAR:default}` placeholders.
37
+
* Environment variable substitution happens at **load time, in memory only** — env vars never overwrite `settings.json` on disk.
38
+
*`docker exec <container> cat /opt/etherpad-lite/settings.json` will therefore always show the *templated* file (e.g. `"port": "${PORT:9001}"`), regardless of what `PORT` is set to in your environment. The resolved value is what Etherpad uses at runtime; the file is unchanged.
39
+
* The admin /settings page also reads this file directly, so the raw view shows placeholders too. The page now surfaces a banner and an "Effective" tab that displays the in-memory resolved values when placeholders are present.
40
+
41
+
### Persisting admin /settings edits across container recreates
42
+
43
+
`settings.json` lives in the container's writable layer by default. That means:
|`docker restart`| Preserved (writable layer is reused) |
48
+
|`docker compose restart`| Preserved |
49
+
|`docker compose down && docker compose up`|**Reset** to the image template |
50
+
|`docker compose pull && docker compose up`|**Reset** to the new image template |
51
+
| Watchtower / image auto-update |**Reset** to the new image template |
52
+
|`docker rm` + `docker run`|**Reset** to the image template |
53
+
54
+
If you intend to edit `settings.json` through the admin UI (rather than relying solely on env vars), mount the file from the host so edits survive container recreate:
(Bootstrap by copying `settings.json.docker` to `./settings.json` on the host before the first `up`.) The default compose example below ships this line commented out — uncomment it if you need persistent on-disk edits.
62
+
32
63
### Rebuilding including some plugins
33
64
If you want to install some plugins in your container, it is sufficient to list them in the ETHERPAD_PLUGINS build variable.
34
65
The variable value has to be a space separated, double quoted list of plugin names (see examples).
@@ -282,6 +313,13 @@ services:
282
313
volumes:
283
314
- plugins:/opt/etherpad-lite/src/plugin_packages
284
315
- etherpad-var:/opt/etherpad-lite/var
316
+
# OPTIONAL: persist admin /settings edits across container recreates.
317
+
# Without this mount, settings.json lives in the image's writable
0 commit comments