Introduce memoryLimit to apps routes

This commit is contained in:
Johannes Zellner
2016-02-11 17:00:21 +01:00
parent a7bf043a9e
commit 75d22d7988
3 changed files with 18 additions and 10 deletions

View File

@@ -156,7 +156,8 @@ function createSubcontainer(app, name, cmd, options, callback) {
dockerPortBindings[containerPort + '/tcp'] = [ { HostIp: '0.0.0.0', HostPort: hostPort + '' } ];
}
var memoryLimit = app.memoryLimit || (developmentMode ? 0 : 1024 * 1024 * 200); // 200mb by default
var memoryLimit = developmentMode ? 0 : (app.memoryLimit || manifest.memoryLimit || (1024 * 1024 * 256)); // 256mb by default
// for subcontainers, this should ideally be false. but docker does not allow network sharing if the app container is not running
// this means cloudron exec does not work
var isolatedNetworkNs = true;