djenriquez/vault-ui

Document how to run vault-ui docker image without nodemon

margueritepd opened this issue · 7 comments

I got this error when running vault-ui as a docker container:

yarn run v0.24.4
$ nodemon ./server.js
[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node ./server.js`
[nodemon] Internal watch failed: watch /app ENOSPC
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Apparently this is related to the fs.inotify.max_user_watches system setting being set too low, similar to what is described here.

Currently it is the docker image's default to serve files via nodemon, which is what is using all these inotify watches:

  1. the CMD in the Dockerfile is here,
  2. which runs yarn serve
  3. which runs nodemon

However, I am not running the container in development. I don't need these file-watching abilities, and I would prefer to circumvent nodemon. I think the correct way to do this is to run the docker image with node server.js or node server.js start_app as the command argument, but I am too unfamiliar with the node toolchain to be certain which is the correct command.

It would be great if you could document the correct way of running the docker container that circumvents nodemon.

You can just replace nodemon with node and you'll run the server without the automatic restarting that nodemon provides. Documentation-wise I can make a small change to point this out.

@Lucretius Thanks. To clarify, it would be good to document how to run the already-built docker image with node, rather than how to change the package.json to run with node.

maxvt commented

If the docker image is primarily intended for people running vault-ui and not developing it (sounds like a reasonable assumption), it would make sense for the default configuration to be intended for production. This might mean using node by default, and switching to nodemon for development only.

No problem guys, this fix should be super quick. Working on it now.

#227 handles the difference between development and default runs. By default, Vault-UI will launch with node.

@margueritepd please test out :latest and verify it fixes the issue you see then close this issue. This issue will be closed otherwise in 48 hours if no response 👍 .

@djenriquez I probably won't get to this before you want to close the ticket, but your change looks good! when I try it, if I run into issues I'll report back here. Thanks a lot!