fix: create data subdirectories on first container start

On a host that has never run the service, the mounted data volume is
empty. Ownership was being corrected for a subdirectory that did not
exist yet, which aborted the entrypoint before the application started
— exactly the situation a fresh deployment creates, and the reason the
container came up on the existing Pi but would not have elsewhere.

Creating the directory has to happen at runtime rather than during the
build, because the volume mount hides whatever the image places there.
This commit is contained in:
Andre
2026-08-14 16:20:54 +02:00
parent 790c744217
commit 77c63770c3
+3 -1
View File
@@ -4,7 +4,9 @@ set -e
APP_UID=${APP_UID:-1000} APP_UID=${APP_UID:-1000}
APP_GID=${APP_GID:-1000} APP_GID=${APP_GID:-1000}
# Fix ownership of mounted volumes so the app user can write to them # Mounted volumes start out empty on a fresh host, and a mount hides anything the
# image created at these paths — so create the directories here, not at build time
mkdir -p /app/tmp /app/data/images
chown "${APP_UID}:${APP_GID}" /app/tmp /app/data /app/data/images chown "${APP_UID}:${APP_GID}" /app/tmp /app/data /app/data/images
# Self-update yt-dlp on every container start (Instagram/TikTok break old versions). # Self-update yt-dlp on every container start (Instagram/TikTok break old versions).