FROM node:0.12.7
RUN apt-get update -y
RUN apt-get install -y libcairo2-dev libjpeg62-turbo-dev libpango1.0-dev libgif-dev build-essential g++ software-properties-common
RUN mkdir /home/dockerthing
EXPOSE 4000
WORKDIR '/home/dockerthing'
ENTRYPOINT ["npm", "run"]
If you need to run things like npm install
(you might), you can change the entrypoint here to just "npm"
and pass -- run {foo}
below.
{
"name" : "dockerthing",
"version" : "0.1.0",
"main" : "main.js",
"scripts": {
"docker" : "docker run -i -t -p 4000:4000 -v `pwd`:/home/dockerthing dockerthing/docker",
"build-docker" : "docker build -t dockerthing/docker .",
"test": "grunt test"
},
"dependencies": {
"grunt": "^0.4.5",
"grunt-contrib-jshint": "~0.10.0"
}
}
$ npm run build-docker
$ npm run docker -- test
That last bit winds up running npm run test
inside of the container which is the same folder as the Dockerfile
since I'm mounting pwd
to /home/dockerthing
.