-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart
More file actions
executable file
·54 lines (45 loc) · 1.63 KB
/
start
File metadata and controls
executable file
·54 lines (45 loc) · 1.63 KB
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
47
48
49
50
51
52
53
54
#!/bin/bash
DEBUG_MODE=false
DEBUG_PORT=15674
ENABLE_TELEMETRY=false
while getopts dg flag
do
case "${flag}" in
d) DEBUG_MODE=true;;
g) ENABLE_TELEMETRY=true;;
esac
done
CMD=""
if [ $DEBUG_MODE = true ]; then
CMD="debugpy --wait-for-client --listen 0.0.0.0:$DEBUG_PORT -m uvicorn app:app --host 0.0.0.0 --port 80 --reload"
fi
trap "echo -ne '\nstopping container...' && docker stop refinery-updater > /dev/null 2>&1 && echo -ne '\t\t [done]\n'" EXIT
HOST_IP=$(docker network inspect bridge --format='{{json .IPAM.Config}}' | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' | tail -1)
echo -ne 'stopping old container...'
docker stop refinery-updater > /dev/null 2>&1
echo -ne '\t [done]\n'
echo -ne 'building container...'
docker build -t refinery-updater-dev -f dev.Dockerfile .
echo -ne '\t\t [done]\n'
echo -ne 'starting...'
docker run -d --rm \
--name refinery-updater \
-p $DEBUG_PORT:$DEBUG_PORT \
-p 7062:80 \
-e S3_ENDPOINT_LOCAL=object-storage:9000 \
-e S3_ACCESS_KEY=kern \
-e S3_SECRET_KEY=r6ywtR33!DMlaL*SUUdy \
-e S3_USE_SSL=0 \
-e NEURAL_SEARCH=http://refinery-neural-search:80 \
-e COGNITION_GATEWAY=http://cognition-gateway:80 \
-e POSTGRES=postgresql://postgres:kern@graphql-postgres:5432 \
-e ENABLE_TELEMETRY=$ENABLE_TELEMETRY \
--mount type=bind,source="$(pwd)"/,target=/app \
-v /var/run/docker.sock:/var/run/docker.sock \
--network dev-setup_default \
refinery-updater-dev $CMD > /dev/null 2>&1
echo -ne '\t\t\t [done]\n'
if [ $DEBUG_MODE = true ]; then
echo -e "\033[0;33muse VSCode Debugger (Python Debugger: refinery-updater) to start the service\033[0m"
fi
docker logs -f refinery-updater