Browse Source

fix: [mongo] use host datastore if available

pull/31/head
Valentin Lab 1 year ago
parent
commit
482e4b55e2
  1. 18
      mongo/lib/common

18
mongo/lib/common

@ -9,12 +9,26 @@ export DATA_DIR=$SERVICE_DATASTORE$DB_DATADIR
is_db_locked() {
is_volume_used "${DATA_DIR}"
local host_db_volume
if [ "${HOST_DATASTORE+x}" ]; then
host_db_volume="$HOST_DATASTORE/${SERVICE_NAME}$DB_DATADIR"
else
host_db_volume="$DATASTORE/${SERVICE_NAME}$DB_DATADIR"
fi
is_volume_used "$host_db_volume"
}
_set_server_db_params() {
server_docker_opts+=("-v" "${SERVICE_CONFIGSTORE}/etc/mongod.conf:/etc/mongod.conf"
local host_config_volume
if [ "${HOST_DATASTORE+x}" ]; then
host_config_volume="$HOST_CONFIGSTORE/${SERVICE_NAME}"
else
host_config_volume="$CONFIGSTORE/${SERVICE_NAME}"
fi
server_docker_opts+=("-v" "${host_config_volume}/etc/mongod.conf:/etc/mongod.conf"
"--add-host" "${SERVICE_NAME}:127.0.0.1")
}

Loading…
Cancel
Save