UUDigitalHumanitieslab / EDPOP

A virtual research environment (VRE) that lets you collect, align and annotate bibliographical and biographical records from several online catalogs.
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

Docker changes #231

Open ar-jan opened 1 month ago

ar-jan commented 1 month ago

I tried building and running the frontend via Docker with docker compose up frontend, but this failed:

frontend-1 | bundles vre/main.js → vre/bundle.js... frontend-1 | [!] (plugin commonjs--resolver) Error: EACCES: permission denied, stat '/root/.node_modules/vre' frontend-1 | Error: EACCES: permission denied, stat '/root/.node_modules/vre'

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?

ar-jan commented 3 weeks ago

I wondered about the node_modules because this setup creates the directory with root ownership on the host system which can be annoying.

jgonggrijp commented 3 weeks ago

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?

ar-jan commented 3 weeks ago

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.

jgonggrijp commented 3 weeks ago

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?

ar-jan commented 3 weeks ago

No, but by default Docker runs as root. I guess you are running Docker rootless mode?

jgonggrijp commented 3 weeks ago

Not consciously? I just installed Docker Desktop and went with it, without configuring anything.