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 |
#!/usr/bin/node |
||||||
var debug = require('debug')('ServiceDock'); |
|
||||||
var app = require('../app'); |
|
||||||
|
|
||||||
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() { |
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", |
"name": "ServiceDock", |
||||||
"version": "2.0.0", |
"version": "2.1.0", |
||||||
"private": true, |
"private": true, |
||||||
"scripts": { |
"scripts": { |
||||||
"start": "nodejs ./bin/www" |
"start": "./bin/www" |
||||||
}, |
}, |
||||||
"dependencies": { |
"dependencies": { |
||||||
"body-parser": "~1.0.0", |
"body-parser": "*", |
||||||
"cookie-parser": "~1.0.1", |
"cookie-parser": "*", |
||||||
"debug": "~0.7.4", |
"debug": "*", |
||||||
"docker.js": "^1.0.1", |
"docker.js": ">=1.2.0", |
||||||
"express": "~4.0.0", |
"express": "*", |
||||||
"morgan": "~1.0.0", |
"morgan": "*", |
||||||
"pug": "^2.0.3", |
"pty.js": "*", |
||||||
"static-favicon": "~1.0.0", |
"pug": "*", |
||||||
"stylus": "0.42.3" |
"socket.io": "*", |
||||||
|
"static-favicon": "*", |
||||||
|
"stylus": "*" |
||||||
} |
} |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue