My Node Dockfile:
# Set the base image to ubuntu
FROM ubuntu
# Define working directory
ADD . /src
WORKDIR /src
# Install Node.js & other
I have found that excluding the entire local node_modules directory does not allow you to install npm packages and have your docker container track those changes in the container on the fly. I will have to rebuild my container each time. To avoid this specify only the bcrypt directory in the container volume and allow docker to track changes when other packages are installed or removed:
volumes:
- .:/app
- /app/node_modules/bcrypt/