likhonsheikhdev commited on
Commit
52c8b5e
·
verified ·
1 Parent(s): 1687e0a

Create entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +25 -0
entrypoint.sh ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ # --model-id will be set by the Docker build argument MODEL_NAME
12
+ text-generation-launcher --model-id ${MODEL_NAME} --num-shard 1 --port 8080 --trust-remote-code &
13
+
14
+ # Wait for text-generation-inference to start
15
+ curl --retry 60 --retry-delay 10 --retry-connrefused http://127.0.0.1:8080/health
16
+
17
+ # Start the chat-ui process
18
+ # It will connect to the text-generation-inference server running on port 8080
19
+ dotenv -e /app/.env -c -- node /app/build/index.js -- --host 0.0.0.0 --port 3000
20
+
21
+ # Wait for any process to exit
22
+ wait -n
23
+
24
+ # Exit with status of process that exited first
25
+ exit $?