Running containers as the root user (UID 0) is a critical security risk. If an attacker compromises the application, they gain root privileges within the container, potentially leading to container escape or host compromise.
# Check the user running inside the containerdocker exec <container-id> whoami# Should output: nodejs (not root)# Verify UIDdocker exec <container-id> id# Should show: uid=1001(nodejs) gid=1001(nodejs)