Reduce docker build time and size and finx nginx config not producing a UI

This commit is contained in:
Karmaa
2025-03-16 20:12:55 -05:00
parent f9d32c597a
commit faa60692e7
2 changed files with 35 additions and 15 deletions

View File

@@ -1,14 +1,24 @@
#!/bin/bash
set -e
# Create MongoDB pid directory if it doesn't exist
mkdir -p /var/run/mongodb
chown mongodb:mongodb /var/run/mongodb
# Start MongoDB
echo "Starting MongoDB..."
mongod --fork --dbpath $MONGODB_DATA_DIR --logpath $MONGODB_LOG_DIR/mongodb.log
mongod --fork --dbpath $MONGODB_DATA_DIR --logpath $MONGODB_LOG_DIR/mongodb.log --pidfilepath /var/run/mongodb/mongod.pid
# Wait for MongoDB to be ready
# Wait for MongoDB to be ready (using mongo instead of mongosh for MongoDB 4.4)
echo "Waiting for MongoDB to start..."
until mongo --eval "print(\"waited for connection\")" > /dev/null 2>&1; do
sleep 0.5
# Check if MongoDB is still running
if ! pgrep -x "mongod" > /dev/null; then
echo "MongoDB failed to start. Checking logs:"
cat $MONGODB_LOG_DIR/mongodb.log
exit 1
fi
done
echo "MongoDB has started"