An example of how to run node.js code stored on external volume on node base image
docker pull node:12-alpine
docker build -t node-docker-volume:1.0.0 .
docker volume create node-docker-volume_1.0.0
docker run --rm \
-v node-docker-volume_1.0.0:/usr/src/app \
--entrypoint=/bin/cp \
node-docker-volume:1.0.0 \
-L -r -a /usr/src/build/. /usr/src/app/
docker run --rm \
--expose 3000 \
-p 3000:3000 \
-v node-docker-volume_1.0.0:/usr/src/app \
-w /usr/src/app \
node:12-alpine \
index.js
docker rmi node-docker-volume:1.0.0
docker run --rm -it --entrypoint /bin/sh node-docker-volume:1.0.0
docker run \
--rm \
-v node-docker-volume_1.0.0:/usr/src/app \
--entrypoint=/bin/ls \
node:12-alpine /usr/src/app -l -a
docker system df -v | grep node-docker-volume_1.0.0