Browse Source

fix run mongo script, include a debug switch

Charles Reid 1 year ago
parent
commit
c2a425f7f5
1 changed files with 31 additions and 14 deletions
  1. 31
    14
      run_mongodb.sh

+ 31
- 14
run_mongodb.sh View File

@@ -8,24 +8,41 @@
8 8
 # http://charlesreid1.com/wiki/Docker/Basics
9 9
 
10 10
 function usage {
11
-	echo ""
12
-	echo "run_mongodb.sh script:"
13
-	echo "run the mongodb docker container."
14
-	echo ""
15
-	echo "        ./run_mongodb.sh"
16
-	echo ""
11
+    echo ""
12
+    echo "run_mongodb.sh script:"
13
+    echo "run the mongodb docker container."
14
+    echo ""
15
+    echo "        ./run_mongodb.sh"
16
+    echo ""
17 17
 }
18 18
 
19
+#debug=false
20
+debug=true
19 21
 
20
-docker run \
21
-    --name happy_mongo \
22
-    -p 192.168.125.28:27017:27017 \
23
-    -p 10.6.0.1:27017:27017 \
24
-    -v /opt/mongodb:/data/db \
25
-    -d \
26
-    -ti jupitermongo
22
+if [ "$debug" == true ]; then
27 23
 
28
-#	--network=host \
24
+    docker run \
25
+        --name happy_mongo \
26
+        -p 27017:27017 \
27
+        -v /opt/mongodb:/data \
28
+        -ti jupitermongo \
29
+        /bin/bash
30
+
31
+else:
32
+
33
+    docker run \
34
+        --name happy_mongo \
35
+        -p 27017:27017 \
36
+        -v /opt/mongodb:/data \
37
+        -d \
38
+        -ti jupitermongo 
39
+
40
+fi
41
+
42
+#    -d \
43
+#    --network=host \
44
+#    -p 10.6.0.1:27017:27017 \
45
+#    -p 127.0.0.1:27017:27017 \
29 46
 
30 47
 # Add this to expose the web interface for MongoDB
31 48
 # (also update the Dockerfile):