DataBiosphere / data-explorer

BSD 3-Clause "New" or "Revised" License
10 stars 6 forks source link

packages in packages.json not installed in UI server container #258

Open melissachang opened 5 years ago

melissachang commented 5 years ago

Problem overview

Unfortunately package.json in docker containers doesn't work as expected.

What should happen:

Sometimes the above works, but sometimes the UI server can't see the new package:

Failed to compile
./src/components/facets/FacetHistogram.js
Module not found: Can't resolve 'vega' in '/ui/src/components/facets'

Repro problem Here's how I can repro the problem. Willy, let me know if this doesn't work for you.

Problem background

In the ui container, we volume mount the github repo ui directory into the container. This is how we get UI server source code into container.

Then in the ui container, we run npm install. This installs packages into /ui/node_modules in the container. So container /ui should be mounted from host, except for /ui/node_modules.

For "mount everything from host except node_modules", most people add a node_modules line to docker-compose.yml. However, that sometimes causes new node_modules packages to not be found, presumably due to this race condition.

Potential solutions

The issue describes alternatives: