Answer the question
In order to leave comments, you need to log in
Why doesn't npm install work inside a docker container?
Everything works on a local wheelbarrow, on a server one of the containers is not built due to the fact that npm cannot download the necessary packages.
Here is the Dockerfile, build hangs on RUN npm install -g express-generator
# Pull base image from stock node image.
FROM node
# Maintainer
MAINTAINER Robert Schultz <[email protected]>
# Add the current working folder as a mapped folder at /usr/src/app
ADD . /usr/src/app
# Set the current working directory to the new mapped folder.
WORKDIR /usr/src/app
# Install the express generator which gives you also scaffolding tools.
RUN npm install -g express-generator
# Scaffold a new express app using hogan.js and less pre-processor.
RUN express -H -f -c less
# Install your application's dependencies
RUN npm install
# Expose the node.js port to the Docker host.
EXPOSE 3000
# This is the stock express binary to start the app.
CMD [ "bin/www" ]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question