Fix #209 by creating .mongorc.js file with proper permissions (#223)

This commit is contained in:
Manish Demblani 2020-07-31 12:11:48 +04:00 committed by GitHub
parent 9c25f21a0c
commit 5ac3e6305f
2 changed files with 6 additions and 1 deletions

View File

@ -68,6 +68,8 @@ export MONGODB_CONF_FILE="$MONGODB_CONF_DIR/mongodb.conf"
export MONGODB_KEY_FILE="$MONGODB_CONF_DIR/keyfile"
export MONGODB_PID_FILE="$MONGODB_TMP_DIR/mongodb.pid"
export MONGODB_LOG_FILE="$MONGODB_LOG_DIR/mongodb.log"
export MONGODB_RC_FILE="$HOME/.mongorc.js"
export MONGODB_DB_SHELL_FILE="$HOME/.dbshell"
export MONGODB_INITSCRIPTS_DIR="/docker-entrypoint-initdb.d"
# System users (when running with a privileged user)

View File

@ -22,7 +22,10 @@ chmod -R g+rwX "$MONGODB_TMP_DIR" "$MONGODB_LOG_DIR" "$MONGODB_CONF_DIR" "$MONGO
render-template "$MONGODB_MONGOD_TEMPLATES_FILE" > "$MONGODB_CONF_FILE"
# Create .dbshell file to avoid error message
touch /.dbshell && chmod g+rw /.dbshell
touch "$MONGODB_DB_SHELL_FILE" && chmod g+rw "$MONGODB_DB_SHELL_FILE"
# Create .mongorc.js file to avoid error message
touch "$MONGODB_RC_FILE" && chmod g+rw "$MONGODB_RC_FILE"
chmod g+w "$MONGODB_CONF_FILE"
# Redirect all logging to stdout
ln -sf /dev/stdout "$MONGODB_LOG_FILE"