Open ar-jan opened 1 month ago
I wondered about the node_modules
because this setup creates the directory with root ownership on the host system which can be annoying.
Isn't that just how Docker volumes are supposed to work? You declare a virtual disk that Docker manages behind your back. It is the same for the database and the python cache. Maybe I'm misunderstanding your question?
I don't mean how Docker manages its internals, but that here the local git repository gets an (empty) directory frontend/node_modules
owned by root:root
. I guess because the volume is mounted into the guest's /usr/src/app
dir.
Strange. I get that empty directory in the host system as well, but it is owned by me, not by root. Did you run docker-compose up
with sudo?
No, but by default Docker runs as root. I guess you are running Docker rootless mode?
Not consciously? I just installed Docker Desktop and went with it, without configuring anything.
I tried building and running the frontend via Docker with
docker compose up frontend
, but this failed:Running the frontend container as the unprivileged
node
user fixes this.As an aside, is there a benefit to storing the node_modules as a volume rather than just having it in the built container?