Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix permissions for npm scripts #173

Merged
merged 5 commits into from
Feb 2, 2024
Merged

Fix permissions for npm scripts #173

merged 5 commits into from
Feb 2, 2024

Conversation

btlogy
Copy link
Contributor

@btlogy btlogy commented Feb 1, 2024

Part of #171

This PR should fix the permissions which were occurring because npm runs as node user regardless if anything else in the container runs as root!
The best option is to simply avoid the root as a best practice too.

But using a specific user/uid + group/gid usually requires some precautions as the current uid is not always 1000 (e.g.: GitHub runner).
The changes covers this with some build-arg which can be used to tune the uid and gid inside the image if needed (e.g.: GitHub workflows).

This PR also proposes a way to install the node modules in the parent directory where the module resolution mechanism will lookup up if they are not found in the current one (if the image is run alone).
Although, the whole idea to npm install the modules twice for the client image (once inside and once outside), but only once for the client-e2e one (outside) is questionable and should be improved separately (see related issue).

@btlogy btlogy self-assigned this Feb 1, 2024
@btlogy btlogy marked this pull request as ready for review February 1, 2024 14:11
@btlogy
Copy link
Contributor Author

btlogy commented Feb 1, 2024

The only possible reviewer is @piegamesde : would you have time for this?

@btlogy
Copy link
Contributor Author

btlogy commented Feb 2, 2024

There is not enough maintainer around to review: merging (deployment is already broken after all).

@btlogy btlogy merged commit 35c770c into main Feb 2, 2024
8 checks passed
@btlogy btlogy deleted the 171.fix-deploy branch February 2, 2024 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant