simple-web-file-upload/entrypoint.sh

12 lines
481 B
Bash

#!/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 "$@"