-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_docker.sh
executable file
·45 lines (39 loc) · 982 Bytes
/
run_docker.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
# Download the models
cd models
if [ ! -d "clip-vit-large-patch14" ] ; then
git clone https://huggingface.co/openai/clip-vit-large-patch14
git lfs install
git lfs pull
fi
cd ..
# Build docker (does not build by default)
if [ $BUILD -eq 1 ]; then
echo "---BUILDING IMAGE---"
docker compose build
fi
# Run docker
DOCKER_COMMAND="docker compose"
if [ $DEMO -eq 1 ]; then
echo "---SETTING DEMO MODE---"
export MODE="demo"
DOCKER_COMMAND="${DOCKER_COMMAND} --profile demo"
else
echo "----SETTING LOCAL MODE---"
export MODE="local"
fi
if [ $INDEX -eq 1 ]; then
echo "---STARTING INDEXER---"
export MODE="local"
DOCKER_COMMAND="${DOCKER_COMMAND} --profile index"
fi
if [ $1 = "start" ]; then
DOCKER_COMMAND="${DOCKER_COMMAND} up -d --remove-orphans"
elif
[ $1 = "stop" ]; then
DOCKER_COMMAND="${DOCKER_COMMAND} down"
else
echo "No option (start, stop) provided!"
exit 1
fi
echo $DOCKER_COMMAND
$DOCKER_COMMAND