Reality123b commited on
Commit
83de17e
·
verified ·
1 Parent(s): 526ef8b

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +11 -11
entrypoint.sh CHANGED
@@ -1,22 +1,22 @@
1
- mkdir -p /data/db
2
-
3
-
4
- find /data/db -name "*.lock" -type f -exec rm -f {} ;
5
-
6
 
 
 
 
 
 
7
  mongod &
8
 
9
-
10
  text-generation-launcher --model-id ${MODEL_NAME} --num-shard 1 --port 8080 --trust-remote-code &
11
 
12
-
13
  curl --retry 60 --retry-delay 10 --retry-connrefused http://127.0.0.1:8080/health
14
 
15
-
16
  dotenv -e /app/.env -c -- node /app/build/index.js -- --host 0.0.0.0 --port 3000
17
-
18
-
19
  wait -n
20
 
21
-
22
  exit $?
 
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
 
10
+ # Start the text-generation-inference process
11
  text-generation-launcher --model-id ${MODEL_NAME} --num-shard 1 --port 8080 --trust-remote-code &
12
 
13
+ # Wait for text-generation-inference to start
14
  curl --retry 60 --retry-delay 10 --retry-connrefused http://127.0.0.1:8080/health
15
 
16
+ # Start the chat-ui process
17
  dotenv -e /app/.env -c -- node /app/build/index.js -- --host 0.0.0.0 --port 3000
18
+ # Wait for any process to exit
 
19
  wait -n
20
 
21
+ # Exit with status of process that exited first
22
  exit $?