Merge pull request #17800 from Starefossen/patch-1

Utillize build cache for Node.js web app example
This commit is contained in:
Sebastiaan van Stijn 2015-11-11 09:56:40 +00:00
commit 9498e9b732
1 changed files with 10 additions and 7 deletions

View File

@ -85,17 +85,18 @@ via-package-manager#rhelcentosscientific-linux-6):
# Install Node.js and npm
RUN yum install -y nodejs npm
Install your app dependencies using the `npm` binary:
# Install app dependencies
COPY package.json /src/package.json
RUN cd /src; npm install
To bundle your app's source code inside the Docker image, use the `COPY`
instruction:
# Bundle app source
COPY . /src
Install your app dependencies using the `npm` binary:
# Install app dependencies
RUN cd /src; npm install
Your app binds to port `8080` so you'll use the `EXPOSE` instruction to have
it mapped by the `docker` daemon:
@ -116,10 +117,12 @@ Your `Dockerfile` should now look like this:
# Install Node.js and npm
RUN yum install -y nodejs npm
# Install app dependencies
COPY package.json /src/package.json
RUN cd /src; npm install
# Bundle app source
COPY . /src
# Install app dependencies
RUN cd /src; npm install
EXPOSE 8080
CMD ["node", "/src/index.js"]