-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathInstall.sh
executable file
·46 lines (36 loc) · 1.13 KB
/
Install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
pwd=`pwd`
__ollama() {
which ollama || curl -fsSL https://ollama.com/install.sh | sh
OLLAMA_HOST=0.0.0.0:11434 ollama serve
ollama pull llama3.2
ollama pull llama3.2-vision
ollama pull llama2-chinese:13b
}
__easysearch() {
[ -d $pwd/easysearch ] || mkdir -p $pwd/easysearch/{data,logs}
sudo chown -R 602:602 $pwd/easysearch
docker run \
-itd --name easysearch \
--hostname easysearch \
--restart=unless-stopped \
-p 9200:9200 \
-v $pwd/easysearch/data:/app/easysearch/data:rw \
-v $pwd/easysearch/logs:/app/easysearch/logs:rw \
infinilabs/easysearch:1.8.3-265
espw=$(docker logs easysearch | grep "admin:" | head -n 1 | cut -d ':' -f 2 | cut -d ' ' -f 1)
echo Easysearch admin password: $espw
coco_exe=`find ~+ -maxdepth 1 -perm -111 -type f -name "*coco*"`
echo $espw | $coco_exe keystore add --force --stdin ES_PASSWORD
}
__main() {
__ollama
__ocr_server
__easysearch
if [ $? -eq 0 ]; then
echo "all set"
else
echo "failed to init, you may try manually go step by step"
fi
}
__main $@