FROM node WORKDIR /app # Copying npm config file setting npm repository location. COPY .npmrc .npmrc # If you add the package.json first and run npm install later, # Docker won’t have to install the dependencies again if you # change the package.json file. # This results from the way the Docker image is being built (layers and cache), # and this is what we should do: COPY package.json /app RUN npm install COPY . /app ENV mongousr=myTester ENV mongopwd=test RUN sh check-env.sh CMD node app.js EXPOSE 3001