I am running a node.js app in a docker container successfully. The node.js app uses a database (nedb) and the db records are stored in the file database.db in the root dir of the app.
I would like to monitor this file from host system and therefore I would like to use a volume not managed by docker and I would like to specify the host directory using this command
docker run -p 4000:4000 --name websrv -v /home/pi/websrv/db:/app websrv:v1.2
however I get the error
npm ERR! enoent ENOENT: no such file or directory, open ‘/app/package.json’
npm ERR! enoent This is related to npm not being able to find a file.
when I use the volume managed by docker
pi@raspberrypi:~/websrv $ docker run -p 4000:4000 --name websrv -v myvol:/app websrv:v1.2
the application is running without error however I cannot monitor the database file becaues volume is managed by docker
Any idea what’s wrong?