Last active
August 29, 2015 14:20
-
-
Save philpoore/f64a29ea7291ce514144 to your computer and use it in GitHub Desktop.
Dockerfile - nodejs
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 node:0.10 | |
| RUN mkdir -p /usr/src/app | |
| WORKDIR /usr/src/app | |
| COPY package.json /usr/src/app/ | |
| RUN npm install | |
| COPY . /usr/src/app | |
| CMD [ "npm", "start" ] |
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
| var app = require('express'); | |
| app.use(function (req, res){ | |
| res.end('Hello World'); | |
| }); | |
| app.listen(process.env.PORT || 8080); |
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": "test-docker", | |
| "version": "0.0.1", | |
| "scripts": { | |
| "start": "node ." | |
| }, | |
| "dependencies": { | |
| "express": "*" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment