This repository has been archived by the owner on May 31, 2021. It is now read-only.
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.
docker: use node lts and run the app as flood user #837
docker: use node lts and run the app as flood user #837
Changes from 3 commits
3ca47b9
25409cc
0434bf2
4c754b6
d004b52
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can we restore the previous, unless there's a good reason to change it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous indentation has 5 spaces. The rest of file has 4 spaces, i think it should use the same. What do you think? If you want to mantain 5 spaces in these lines, i can revert it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am concerned if adding a user now will break existing setups, looking at existing docker volume for
/data
currently there are files owned by theroot
user which when the app runs under theflood
user would in theory not have access the database file. Rebuilding the container will not change the files/owners of existing files on docker volumes.I will have a quick test on my local setup to see what effects there are on my setup when a build new image with these changes, may require users to manually run
chown
after re-building the image.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you been able to test how it affects current configurations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MacTwister maybe the file are own by root because the docker image was built and the default user was root but if you build it and add another user the file will be own by another user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, so now if you build the docker image on your side using this Dockerfile (with chown changes) then the app will be owned and run as the
flood
user. 👍For new setups using docker:
New container will run as
flood
user and create the database under/data
owned by theflood
user. All good here.For existing setups using docker:
The scenario I am describing is for people already running with Docker and have setup the
/data
folder as a "volume" to persist the DB when restarting/upgrading the docker image. Below is simplified version to how I have my setup:So when re-creating the container with new image, the app will crash with the following error:
This is because my volume
/data
is persisted over from the previous container, where it was first created (when container was root only) so my version of/data
is owned byroot:root
.What I am saying is that, if we go through with this change, we'd need to some how inform users what they would need to do to continue working after this upgrade. i.e. update the docs for docker setup to inform the to update the /data ownership manually.
What I needed to do using my docker compose setup to continue working: