Note this is all already done for us in Official repos that run an app, like Nginx, MySQL, etc.
It’s NOT enabled with the USER command in programming language Official images, like Node.js, Python, etc. You’ll need to add USER <username> yourself for those, depending on if you app works as a non-root user.
NOTE: In order to make sure the new user can run the app, you might need to include some additional chown commands to give permissions to the new user.