merge start options into hostconfig

This commit is contained in:
Girish Ramakrishnan
2015-10-19 21:35:02 -07:00
parent 15aa4ecc5d
commit fb56795cbd

View File

@@ -762,10 +762,8 @@ function setupRedis(app, options, callback) {
'/tmp': {}, '/tmp': {},
'/run': {} '/run': {}
}, },
VolumesFrom: [] VolumesFrom: [],
}; HostConfig: {
var startOptions = {
Binds: [ Binds: [
redisVarsFile + ':/etc/redis/redis_vars.sh:ro', redisVarsFile + ':/etc/redis/redis_vars.sh:ro',
redisDataDir + ':/var/lib/redis:rw' redisDataDir + ':/var/lib/redis:rw'
@@ -780,6 +778,7 @@ function setupRedis(app, options, callback) {
'Name': 'always', 'Name': 'always',
'MaximumRetryCount': 0 'MaximumRetryCount': 0
} }
}
}; };
var env = [ var env = [
@@ -794,7 +793,7 @@ function setupRedis(app, options, callback) {
docker.createContainer(createOptions, function (error) { docker.createContainer(createOptions, function (error) {
if (error && error.statusCode !== 409) return callback(error); // if not already created if (error && error.statusCode !== 409) return callback(error); // if not already created
redisContainer.start(startOptions, function (error) { redisContainer.start(function (error) {
if (error && error.statusCode !== 304) return callback(error); // if not already running if (error && error.statusCode !== 304) return callback(error); // if not already running
appdb.setAddonConfig(app.id, 'redis', env, function (error) { appdb.setAddonConfig(app.id, 'redis', env, function (error) {