File size: 359 Bytes
26488bb
 
3547cc1
 
26488bb
 
 
 
 
 
 
3547cc1
 
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash

# Start MongoDB as mongodb user
mongod --replSet rs0 --bind_ip_all --dbpath /data/db &

# Wait for MongoDB to start
sleep 10

# Initialize replica set
mongosh --eval "rs.initiate({_id: 'rs0', members: [{_id: 0, host: 'localhost:27017'}]})"

# Switch to rocketchat user and start the application
su - rocketchat -c "cd /app/bundle && node main.js"