Add non-root user support and entrypoint script for Docker setup

This commit is contained in:
2026-06-06 17:27:10 +02:00
parent 21620290e2
commit 5ad2ad691f
3 changed files with 27 additions and 6 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
set -e
PUID=${PUID:-1001}
PGID=${PGID:-1001}
# Only remap if the requested IDs differ from the defaults baked into the image
if [ "$PGID" != "1001" ]; then
groupmod -g "$PGID" nodejs
fi
if [ "$PUID" != "1001" ]; then
usermod -u "$PUID" nextjs
fi
chown -R nextjs:nodejs /data
exec su-exec nextjs "$@"