#!/bin/bash # Start MongoDB mongod --fork --logpath /var/log/mongodb.log # Wait for MongoDB to be ready until mongosh --eval "print(\"waited for connection\")" > /dev/null 2>&1; do echo "Waiting for MongoDB to be ready..." sleep 1 done su rocketchat # Start the Node.js application exec node /app/bundle/main.js