Spaces:
Runtime error
Runtime error
debug
Browse files
start.sh
CHANGED
@@ -2,39 +2,40 @@
|
|
2 |
set -e
|
3 |
|
4 |
echo "Starting MongoDB..."
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
2 |
set -e
|
3 |
|
4 |
echo "Starting MongoDB..."
|
5 |
+
tail -f /dev/null
|
6 |
+
# mongod --config /etc/mongod.conf &
|
7 |
+
|
8 |
+
# # Wait for MongoDB to be ready
|
9 |
+
# echo "Waiting for MongoDB to start..."
|
10 |
+
# max_attempts=30
|
11 |
+
# attempt=1
|
12 |
+
|
13 |
+
# echo $(ls -l /data/)
|
14 |
+
|
15 |
+
# while ! mongosh --quiet --eval "db.version()" > /dev/null 2>&1; do
|
16 |
+
# if [ $attempt -gt $max_attempts ]; then
|
17 |
+
# echo "MongoDB failed to start. Showing logs:"
|
18 |
+
# cat /var/log/mongodb.log
|
19 |
+
# exit 0
|
20 |
+
# fi
|
21 |
+
# echo "Attempt $attempt of $max_attempts: MongoDB not ready yet..."
|
22 |
+
# sleep 2
|
23 |
+
# attempt=$((attempt + 1))
|
24 |
+
# done
|
25 |
+
|
26 |
+
# echo "MongoDB started successfully"
|
27 |
+
|
28 |
+
# # Initialize replica set
|
29 |
+
# echo "Initializing replica set..."
|
30 |
+
# mongosh --eval 'rs.initiate({_id: "rs01", members: [{_id: 0, host: "localhost:27017"}]})' || {
|
31 |
+
# echo "Failed to initialize replica set"
|
32 |
+
# exit 0
|
33 |
+
# }
|
34 |
+
|
35 |
+
# echo "Waiting for replica set to initialize..."
|
36 |
+
# sleep 5
|
37 |
+
|
38 |
+
# # Start Rocket.Chat
|
39 |
+
# echo "Starting Rocket.Chat..."
|
40 |
+
# cd /opt/Rocket.Chat
|
41 |
+
# exec node main.js
|