Only wait for a single port

This commit is contained in:
Jose Diaz-Gonzalez
2016-08-26 23:05:22 -04:00
parent 6fb3589833
commit df77033516
2 changed files with 2 additions and 1 deletions

1
config
View File

@@ -7,6 +7,7 @@ export MONGO_CONFIG_OPTIONS=${MONGO_CONFIG_OPTIONS:=" --storageEngine wiredTiger
export PLUGIN_COMMAND_PREFIX="mongo"
export PLUGIN_DATA_ROOT=$MONGO_ROOT
export PLUGIN_DATASTORE_PORTS=(27017 27018 27019 28017)
export PLUGIN_DATASTORE_WAIT_PORT=27017
export PLUGIN_DEFAULT_ALIAS="MONGO"
export PLUGIN_ALT_ALIAS="DOKKU_MONGO"
export PLUGIN_IMAGE=$MONGO_IMAGE

View File

@@ -390,7 +390,7 @@ service_create_container() {
echo "$ID" > "$SERVICE_ROOT/ID"
dokku_log_verbose_quiet "Waiting for container to be ready"
docker run --rm --link "$SERVICE_NAME:$PLUGIN_COMMAND_PREFIX" dokkupaas/wait > /dev/null
docker run --rm --link "$SERVICE_NAME:$PLUGIN_COMMAND_PREFIX" dokkupaas/wait -p "$PLUGIN_DATASTORE_WAIT_PORT" > /dev/null
echo "db.createUser({user:'admin',pwd:'$ROOTPASSWORD',roles:[{role:'userAdminAnyDatabase',db:'admin'},{role:'__system',db:'admin'},{role:'root',db:'admin'}]})" | docker exec -i "$SERVICE_NAME" mongo admin > /dev/null
echo "db.createUser({user:'$SERVICE',pwd:'$PASSWORD',roles:[{role:'readWrite',db:'$SERVICE'}]})" | docker exec -i "$SERVICE_NAME" mongo -u admin -p "$ROOTPASSWORD" --authenticationDatabase admin "$SERVICE" > /dev/null