Open electrofloat opened 1 year ago
That's the standard of node:alpine. But feel free to make some suggestions
Yes. That's why I'm suggesting to do the same as linuxserver does. (https://github.com/linuxserver/docker-baseimage-alpine/blob/master/root/etc/s6-overlay/s6-rc.d/init-adduser/run) Use PUID and PGID env variables (which will be given by the user creating the container with --env), and either create a new user in your image with those ids for ex.:
groupmod -o -g "$PGID" abc
usermod -o -u "$PUID" abc
.
.
chown abc:abc /folder_used_by_your_app
or change the uid/gid of use node to the one provided in the env variables, for ex.:
usermod -u "$PUID" node
groupmod -g "$PGID" nodegroup
.
.
find / -group "$PGID" -exec chgrp -h nodegroup {} \;
find / -user "$PUID" -exec chown -h node {} \;
The last one of course assumes that the numbers given through env are available in the image itself, so probably the first one is safer to use.
If you like prep a pr
Using id 1000 is very restrictive.
Would be a tons better if one could just give the uid/gid through env variables like what linuxserver.io does: https://docs.linuxserver.io/general/understanding-puid-and-pgid