Spaces:
Runtime error
Runtime error
Add creating `/data/db` directory for persistent storage
#5
by
gabrielmbmb
HF staff
- opened
- entrypoint.sh.template +4 -0
entrypoint.sh.template
CHANGED
@@ -1,5 +1,9 @@
|
|
1 |
#!/bin/bash
|
2 |
|
|
|
|
|
|
|
|
|
3 |
# Start the local Mongo database
|
4 |
mongod &
|
5 |
|
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
+
# Make sure `/data/db` directory exists even with persistent storage
|
4 |
+
mkdir -p /data/db
|
5 |
+
# If app crashed, mongo didn't stop gracefully. Remove all the old *.lock files
|
6 |
+
find /data/db -name "*.lock" -type f -exec rm -f {} \;
|
7 |
# Start the local Mongo database
|
8 |
mongod &
|
9 |
|