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:
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Wenn die Bind-Mounts (data/db, data/uploads, data/logo) auf dem Host noch
|
||||
# nicht existieren, legt Docker sie als root an — der App-Prozess (UID 1000)
|
||||
# könnte dann nicht reinschreiben ("readonly database"). Das fangen wir hier ab.
|
||||
mkdir -p /data/db /data/uploads /data/logo /webdav-config
|
||||
chown -R 1000:1000 /data /webdav-config 2>/dev/null || true
|
||||
|
||||
# Privilegien fallen lassen und das eigentliche Kommando als UID 1000 ausführen.
|
||||
exec gosu 1000:1000 "$@"
|
||||
Reference in New Issue
Block a user