-
Notifications
You must be signed in to change notification settings - Fork 1
/
start
executable file
·39 lines (34 loc) · 1.32 KB
/
start
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
#!/bin/bash
trap "echo -ne '\nstopping container...' && docker stop refinery-weak-supervisor > /dev/null 2>&1 && echo -ne '\t\t [done]\n'" EXIT
echo -ne 'stopping old container...'
docker stop refinery-weak-supervisor > /dev/null 2>&1
echo -ne '\t [done]\n'
INFERENCE_DIR=${PWD%/*}/dev-setup/inference/
if [ ! -d "$INFERENCE_DIR" ]
then
INFERENCE_DIR=${PWD%/*/*}/dev-setup/inference/
if [ ! -d "$INFERENCE_DIR" ]
then
# to include volume for local development, use the dev-setup inference folder:
# alternative use manual logic with
# -v /path/to/dev-setup/inference:/models \
echo "Can't find model data directory: $INFERENCE_DIR -> stopping"
exit 1
fi
fi
echo -ne 'building container...'
docker build -t refinery-weak-supervisor-dev -f dev.Dockerfile . > /dev/null 2>&1
echo -ne '\t\t [done]\n'
echo -ne 'starting...'
docker run -d --rm \
--name refinery-weak-supervisor \
-p 7054:80 \
-e POSTGRES=postgresql://postgres:kern@graphql-postgres:5432 \
-e WS_NOTIFY_ENDPOINT="http://refinery-websocket:8080" \
--mount type=bind,source="$(pwd)"/,target=/app \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "$INFERENCE_DIR":/inference \
--network dev-setup_default \
refinery-weak-supervisor-dev > /dev/null 2>&1
echo -ne '\t\t\t [done]\n'
docker logs -f refinery-weak-supervisor