Add non-root user support and entrypoint script for Docker setup
This commit is contained in:
@@ -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 "$@"
|
||||
Reference in New Issue
Block a user