parent
7096587f3a
commit
4d4f2e9a92
9 changed files with 60 additions and 33 deletions
@ -0,0 +1,19 @@ |
||||
FROM mwaeckerlin/base |
||||
MAINTAINER mwaeckerlin |
||||
|
||||
ENV PORT 4000 |
||||
|
||||
ENV CONTAINERNAME "servicedock" |
||||
RUN adduser -D npm |
||||
ADD --chown=npm . /app |
||||
WORKDIR /app |
||||
RUN apk add npm python docker make g++ \ |
||||
&& npm install npm@latest -g \ |
||||
&& rm -rf node_modules \ |
||||
&& npm install \ |
||||
&& npm audit fix --force \ |
||||
&& apk del python make g++ |
||||
#USER npm |
||||
|
||||
EXPOSE $PORT |
||||
VOLUME /var/run/docker.sock |
@ -1,9 +1,17 @@ |
||||
#!/usr/bin/nodejs |
||||
var debug = require('debug')('ServiceDock'); |
||||
var app = require('../app'); |
||||
#!/usr/bin/node |
||||
|
||||
app.set('port', process.env.PORT || 4000); |
||||
var debug = require('debug')('ServiceDock') |
||||
var app = require('../app') |
||||
|
||||
app.set('port', process.env.PORT || 4000) |
||||
|
||||
var server = app.listen(app.get('port'), function() { |
||||
debug('Express server listening on port ' + server.address().port); |
||||
}); |
||||
debug('Express server listening on port ' + server.address().port) |
||||
}) |
||||
var io = require('socket.io').listen(server) |
||||
var docker = require('docker.js')(app, io) |
||||
|
||||
io.sockets.on('connection', docker.connect) |
||||
debug('Socket server listening on port ' + server.address().port); |
||||
|
||||
|
||||
|
@ -1,19 +1,21 @@ |
||||
{ |
||||
"name": "ServiceDock", |
||||
"version": "2.0.0", |
||||
"version": "2.1.0", |
||||
"private": true, |
||||
"scripts": { |
||||
"start": "nodejs ./bin/www" |
||||
"start": "./bin/www" |
||||
}, |
||||
"dependencies": { |
||||
"body-parser": "~1.0.0", |
||||
"cookie-parser": "~1.0.1", |
||||
"debug": "~0.7.4", |
||||
"docker.js": "^1.0.1", |
||||
"express": "~4.0.0", |
||||
"morgan": "~1.0.0", |
||||
"pug": "^2.0.3", |
||||
"static-favicon": "~1.0.0", |
||||
"stylus": "0.42.3" |
||||
"body-parser": "*", |
||||
"cookie-parser": "*", |
||||
"debug": "*", |
||||
"docker.js": ">=1.2.0", |
||||
"express": "*", |
||||
"morgan": "*", |
||||
"pty.js": "*", |
||||
"pug": "*", |
||||
"socket.io": "*", |
||||
"static-favicon": "*", |
||||
"stylus": "*" |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue