Docker docs: /data chowns itself now, so stop asking operators to

c173ca3 gave the API Server image a root entrypoint that takes ownership of
/data and then drops to app via su-exec, which left the Volumes note in
Docker/README.md telling operators to do by hand something the image now
does for them.

The replacement says what actually happens, and keeps the two cases the
entrypoint cannot cover: a container forced to another user (`user:` in
compose, `docker run --user`) has no privileges to chown with, so its host
directory still needs preparing. It also points at the new boot warning as
the thing to look for, since the alternative symptom - plugins that enable
normally in the panel and come back disabled after a redeploy - gives no
hint about permissions.

Also states that PocketBase runs as root, so PB_DATA never had this
problem; the old note read as though it applied to both volumes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
tajniak81
2026-08-21 16:39:23 +02:00
co-authored by Claude Opus 5
parent c173ca3653
commit d2803bbd93
+14 -5
View File
@@ -63,11 +63,20 @@ schema reconcile itself.
Both default to Docker-managed named volumes. In the prod file, set `PB_DATA` / Both default to Docker-managed named volumes. In the prod file, set `PB_DATA` /
`API_DATA` to absolute host paths for bind mounts instead. `API_DATA` to absolute host paths for bind mounts instead.
> The API Server container runs as an unprivileged user, and a **named** volume > The API Server serves as the unprivileged `app` user, so `/data` has to be
> inherits that ownership from the image. A **bind mount** does not — the host > writable by it. Its entrypoint arranges that itself: it starts as root, takes
> directory's ownership wins, so `chown` it to the container's `app` user (or > ownership of `/data` if `app` does not already hold it, then drops privileges.
> `chmod` it writable) before setting `API_DATA` to a host path, otherwise the > So a **bind mount** to a root-owned host path needs no manual `chown`, and
> server cannot write `plugins.json`. > neither does a **named volume** left over from an image that ran as root. The
> one case it cannot fix is a container forced to another user (`user:` in
> compose, `docker run --user`), where the entrypoint has no privileges to
> `chown` with — prepare the host directory yourself there.
>
> If `/data` is still unwritable the server says so at boot, with
> `WARNING: plugin changes will NOT survive a restart`. That warning is worth
> watching for: the alternative symptom is plugins that enable normally in the
> panel and come back disabled after the next redeploy. PocketBase runs as
> root, so `PB_DATA` is unaffected either way.
## Charger control (OCPP) ## Charger control (OCPP)