Created
August 10, 2025 06:11
-
-
Save sagarpanda/6819311241390d09f63b1b723c6cd666 to your computer and use it in GitHub Desktop.
Run container as non-root
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # create group and user | |
| RUN groupadd -r myapp && useradd -g myapp myapp | |
| # set ownership and permissions | |
| RUN chown pr myapp:myapp /app | |
| # switch to user | |
| USER myapp | |
| CMD node index.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment