kubernete example app
This commit is contained in:
6
Dockerfile
Normal file
6
Dockerfile
Normal 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
10
index.js
Normal 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
12
package.json
Normal 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"
|
||||
}
|
||||
Reference in New Issue
Block a user