Начальный коммит
All checks were successful
Docker / build (push) Successful in 1m0s

This commit is contained in:
2025-03-04 15:30:28 +04:00
commit ab3a808032
8 changed files with 230 additions and 0 deletions

21
start.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
set -euo pipefail
chmod +x /scripts/*
ls -l /scripts/
if [ ! -f /data/db/replS.et ]; then
echo "Can't find /data/db/replS.et! Setting up replSet..."
touch /data/db/replS.et
/usr/bin/mongod --bind_ip_all --replSet "$MONGO_REPLICA_SET_NAME" &
sleep 5 && bash /scripts/rs-init.sh
fi
cp "$MONGO_KEY_FILE_PATH" "$MONGO_KEY_FILE_TARGET_PATH"
chmod 600 "$MONGO_KEY_FILE_TARGET_PATH"
echo "File exists! Skipping replSet..."
echo "KeyFile $MONGO_KEY_FILE_TARGET_PATH"
exec "$@"