My Node Dockfile
:
# Set the base image to ubuntu
FROM ubuntu
# Define working directory
ADD . /src
WORKDIR /src
# Install Node.js & other
Make sure that you are not copying the node_modules
folder. I got this error when using the official nodejs "onbuild" image which would copy everything...
Now I use:
.dockerignore
node_modules
dockerfile
FROM node:6.4.0
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN npm install
COPY . /usr/src/app
CMD [ "npm", "start" ]
EXPOSE 6969
Edit: The official NodeJS Docker starter image project on Github has accepted my pull request for ther README which instructs to explicitly ignore the node_modules.