-
-
Save cicorias/ade1e888a5d6e1bff30180ff4789486e to your computer and use it in GitHub Desktop.
testProject
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu | |
MAINTAINER David Weinstein <[email protected]> | |
# install our dependencies and nodejs | |
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list | |
RUN apt-get update | |
RUN apt-get -y install python-software-properties git build-essential | |
RUN add-apt-repository -y ppa:chris-lea/node.js | |
RUN apt-get update | |
RUN apt-get -y install nodejs | |
# use changes to package.json to force Docker not to use the cache | |
# when we change our application's nodejs dependencies: | |
ADD package.json /tmp/package.json | |
RUN cd /tmp && npm install | |
RUN mkdir -p /opt/app && cp -a /tmp/node_modules /opt/app/ | |
# From here we load our application's code in, therefore the previous docker | |
# "layer" thats been cached will be used if possible | |
WORKDIR /opt/app | |
ADD . /opt/app | |
EXPOSE 3000 | |
CMD ["node", "server.js"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "testProject", | |
"description": "this project is awesome", | |
"version": "0.0.1", | |
"private": true, | |
"scripts": { | |
"start": "node server.js" | |
}, | |
"dependencies": { | |
"async": "*" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this is our simulated application code | |
// | |
var async=require('async'); | |
// uncomment the following line after building the project | |
// docker will use the cache for the modules... | |
// console.log('hello'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment