Skip to content

Commit

Permalink
dockerize
Browse files Browse the repository at this point in the history
  • Loading branch information
Zolmeister committed Sep 23, 2016
1 parent d418f13 commit f839ae7
Show file tree
Hide file tree
Showing 305 changed files with 5,122 additions and 17,203 deletions.
15 changes: 15 additions & 0 deletions Dockerfile
@@ -0,0 +1,15 @@
FROM node:6.6.0

# npm-shrinkwrap.json, package.json
COPY *.json /tmp/
RUN mkdir -p /opt/app && \
cd /opt/app && \
cp /tmp/npm-shrinkwrap.json . && \
cp /tmp/package.json . && \
npm install --production --unsafe-perm --loglevel warn

COPY . /opt/app

WORKDIR /opt/app

CMD ["npm", "start"]
35 changes: 13 additions & 22 deletions app.js
@@ -1,33 +1,24 @@

/**
* Module dependencies.
*/

var express = require('express')
, http = require('http')
, path = require('path');

var app = express();
var port = process.env.PORT || 3000;

app.configure(function(){
app.set('port', process.env.PORT || 3005);
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));
app.all('/', function(req, res){
res.sendFile(path.join(__dirname, 'views/index.html'));
});

app.configure('development', function(){
app.use(express.errorHandler());
});
app.get('/ping', function (req, res) {
res.send('pong');
})

app.get('/', function(req, res){
res.sendfile('views/index.html');
app.get('/manifest.webapp', function(req, res){
res.header('Content-Type', 'application/x-web-app-manifest+json');
res.sendfile('manifest.webapp');
});

http.createServer(app).listen(app.get('port'), function(){
console.log("Express server listening on port " + app.get('port'));
app.use(express.static(path.join(__dirname, 'public')));

app.listen(port, function(){
console.log("Express server listening on port " + port);
});
9 changes: 0 additions & 9 deletions node_modules/express/.npmignore

This file was deleted.

3 changes: 0 additions & 3 deletions node_modules/express/.travis.yml

This file was deleted.

0 comments on commit f839ae7

Please sign in to comment.