kubernete example app

This commit is contained in:
Vivek Amin
2018-10-07 00:37:33 -07:00
commit e1f3376dc7
3 changed files with 28 additions and 0 deletions

6
Dockerfile Normal file
View File

@@ -0,0 +1,6 @@
FROM node:8.12.0-alpine
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN npm install
CMD ["npm", "start"]

10
index.js Normal file
View File

@@ -0,0 +1,10 @@
const http = require('http');
const port = process.env.PORT || 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World\n');
});
server.listen(port, () => {
console.log(`Server running on port: ${port}`);
});

12
package.json Normal file
View File

@@ -0,0 +1,12 @@
{
"name": "node-app",
"version": "1.0.0",
"description": "Kuberntes Test Node app",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start" : "node index.js"
},
"author": "Vivek Amin",
"license": "ISC"
}