docker: Set the home directory for the user #3676
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this change, the docker user had home in a directory it had no
permissions on. The inability of creating a cache directory in
$HOME
prevented npm to work properly.
Additionally, the
node_modules
in the base working directory had itsowner set to root, preventing further changes.
With this change, the
etherpad
user has a home directory.Additionally,
npm i
is now run byetherpad
rather than the rootuser; this way, it is possible to dynamically change the
node_modules
content in day 2 operations.
Note that while switching to the
useradd
builtin, a conflict wasdiscovered with the GID 65534 that was previously used. This change is
changing the
etherpad
user's UID to 5001 to avoid said conflict. As aconsequence, a
chmod -R 5001:5001
must be run prior to attachingvolumes created from previous Etherpad versions.