Auto-create and chown data dirs on first start

Entrypoint runs as root, ensures /data/{db,uploads,logo} and
/webdav-config exist with UID 1000 ownership, then drops privileges
via gosu. Removes the manual sudo chown step from the README and
makes a fresh docker compose up succeed without prep.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Stefan Hacker
2026-04-16 13:20:02 +02:00
parent d476784c06
commit 20e61aa61c
4 changed files with 22 additions and 7 deletions
+4 -5
View File
@@ -41,11 +41,10 @@ docker compose up -d --build
- `./data/uploads/` → ein Unterordner pro Kunde (Slug)
- Named Volume `webdav-config` → dynamisch generierte Apache-Config
Beide Container laufen als UID `1000:1000`. Falls vorhandene Daten root gehören:
```bash
sudo chown -R 1000:1000 data/
```
Beide Container laufen als UID `1000:1000`. Der App-Container startet kurz
als root, korrigiert die Eigentümer der `./data/`-Mountpunkte auf `1000:1000`
und droppt dann via `gosu` die Privilegien — fresh deploys laufen also ohne
manuellen `chown` durch.
## Wie die WebDAV-ACLs funktionieren