create docker image

This commit is contained in:
Robin Appelman 2017-04-08 22:08:06 +02:00
commit 5397a3e9ed
6 changed files with 28 additions and 34 deletions

2
.dockerignore Normal file
View file

@ -0,0 +1,2 @@
node_modules
*.log

12
Dockerfile Normal file
View file

@ -0,0 +1,12 @@
FROM node:7.8-alpine
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN npm install
COPY index.js /usr/src/app/
EXPOSE 80
CMD [ "node", "/usr/src/app/index.js" ]

View file

@ -1,7 +0,0 @@
{
"name": "Node.js Getting Started",
"description": "A barebones Node.js app using Express 4",
"repository": "https://github.com/heroku/node-js-getting-started",
"logo": "http://node-js-sample.herokuapp.com/node.svg",
"keywords": ["node", "express", "static"]
}

View file

@ -5,7 +5,7 @@ var url = require('url');
var https = require('https'); var https = require('https');
var http = require('http'); var http = require('http');
app.set('port', (process.env.PORT || 5000)); app.set('port', (process.env.PORT || 80));
app.use(express.static(__dirname + '/public')); app.use(express.static(__dirname + '/public'));
app.get('/', function (request, response) { app.get('/', function (request, response) {
@ -18,14 +18,18 @@ function handleDataStream (stream, cb) {
buffers.push(buffer); buffers.push(buffer);
}); });
stream.on('end', function () { stream.on('end', function () {
var buffer = Buffer.concat(buffers); try {
var demo = DemoParser.Demo.fromNodeBuffer(buffer); var buffer = Buffer.concat(buffers);
var parser = demo.getParser(true); var demo = DemoParser.Demo.fromNodeBuffer(buffer);
var header = parser.readHeader(); var parser = demo.getParser(true);
var match = parser.parseBody(); var header = parser.readHeader();
var body = match.getState(); var match = parser.parseBody();
body.header = header; var body = match.getState();
cb(body); body.header = header;
cb(body);
} catch (e) {
cb(e);
}
}); });
} }

View file

@ -8,7 +8,7 @@
}, },
"dependencies": { "dependencies": {
"express": "~4.9.x", "express": "~4.9.x",
"tf2-demo": "1.1.1" "tf2-demo": "1.1.3"
}, },
"engines": { "engines": {
"node": "0.10.x" "node": "0.10.x"

View file

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
<path fill="#8CC84B" d="M255.5,495.4c-6.4,0-12.8-1.7-18.4-4.9l-58.5-34.6c-8.7-4.9-4.5-6.6-1.6-7.6c11.7-4,14-5,26.5-12
c1.3-0.7,3-0.5,4.4,0.3l45,26.7c1.6,0.9,3.9,0.9,5.4,0L433.6,362c1.6-0.9,2.7-2.8,2.7-4.7V154.9c0-2-1-3.8-2.7-4.8L258.3,49
c-1.6-0.9-3.8-0.9-5.4,0L77.7,150.1c-1.7,1-2.8,2.9-2.8,4.8v202.3c0,1.9,1.1,3.8,2.8,4.7l48,27.7c26.1,13,42-2.3,42-17.7V172.2
c0-2.8,2.3-5.1,5.1-5.1H195c2.8,0,5.1,2.2,5.1,5.1V372c0,34.8-18.9,54.7-51.9,54.7c-10.1,0-18.1,0-40.4-11l-46-26.5
c-11.4-6.6-18.4-18.8-18.4-32V154.9c0-13.1,7-25.4,18.4-32L237.1,21.7c11.1-6.3,25.8-6.3,36.8,0L449.3,123
c11.4,6.6,18.4,18.8,18.4,32v202.3c0,13.1-7.1,25.4-18.4,32L274,490.5C268.4,493.7,262,495.4,255.5,495.4z"/>
<path fill="#8CC84B" d="M309.7,356c-76.7,0-92.8-35.2-92.8-64.8c0-2.8,2.3-5.1,5.1-5.1h22.7c2.5,0,4.6,1.8,5,4.3
c3.4,23.1,13.6,34.7,60,34.7c36.9,0,52.7-8.4,52.7-28c0-11.3-4.5-19.7-61.9-25.3c-48-4.7-77.6-15.3-77.6-53.7
c0-35.4,29.8-56.5,79.8-56.5c56.2,0,84,19.5,87.5,61.3c0.1,1.4-0.4,2.8-1.3,3.9c-1,1-2.3,1.6-3.7,1.6h-22.8c-2.4,0-4.4-1.7-4.9-4
c-5.5-24.3-18.7-32-54.8-32c-40.3,0-45,14-45,24.6c0,12.8,5.5,16.5,60,23.7c53.9,7.1,79.5,17.2,79.5,55.1
C397.1,334.1,365.3,356,309.7,356z"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB