nsarrazin HF staff gabrielmbmb commited on
Commit
feb1b1e
1 Parent(s): af09f20

Add creating `/data/db` directory for persistent storage (#5)

Browse files

- Add creating `/data/db` directory for persistent storage (c6fdfc40c13c8b96878289ecf7b533066964c323)
- Remove old `mongod.lock` file (0fd5f18c9061d2426d3cc0ad0c8f8bedd561a19d)
- Add removing multiple mongo *.lock files (0bf7d949000a04f9bffd90f156e8693d7c6ec0f8)
- Update entrypoint.sh.template (1ed57be4f33963c2d2f1156a4ceea2870cc8da62)


Co-authored-by: Gabriel Martín Blázquez <gabrielmbmb@users.noreply.huggingface.co>

Files changed (1) hide show
  1. 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