Reduce docker build time and size and finx nginx config not producing a UI
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user