diff --git a/config b/config index 0dc5372..0ebc607 100644 --- a/config +++ b/config @@ -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 diff --git a/functions b/functions index f573889..5388c08 100755 --- a/functions +++ b/functions @@ -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