Update entrypoint.sh
All checks were successful
Build and publish / Build Container (push) Successful in 18s

This commit is contained in:
2026-05-29 22:02:01 -04:00
parent 2ed87ffdd6
commit 090c28fc62

View File

@@ -7,10 +7,13 @@ if [ -n "$BACKUP_CRON" ]; then
cron
fi
# Clean up stale locks from unclean shutdown
rm -f /data/db/mongod.lock
rm -f /data/db/.lock
rm -f /data/db/WiredTiger.lock
# Clean locks & repair only if lock files exist (unclean shutdown)
if [ -f /data/db/mongod.lock ] || [ -f /data/db/WiredTiger.lock ] || [ -f /data/db/.lock ]; then
echo "Stale locks detected, running repair..."
rm -f /data/db/mongod.lock /data/db/.lock /data/db/WiredTiger.lock
mongod --replSet rs0 --repair
echo "Repair complete, starting normally..."
fi
# Hand off to normal mongo entrypoint
exec /usr/local/bin/docker-entrypoint.sh "$@"