-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstart
More file actions
executable file
·42 lines (34 loc) · 1.12 KB
/
start
File metadata and controls
executable file
·42 lines (34 loc) · 1.12 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
#!/bin/bash
DEBUG_MODE=false
DEBUG_PORT=15672
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 main:app --host 0.0.0.0 --port 80 --reload"
fi
trap "echo -ne '\nstopping container...' && docker stop refinery-authorizer > /dev/null 2>&1 && echo -ne '\t\t [done]\n'" EXIT
echo -ne 'stopping old container...'
docker stop refinery-authorizer > /dev/null 2>&1
echo -ne '\t [done]\n'
echo -ne 'building container...'
docker build -t refinery-authorizer-dev -f dev.Dockerfile .
echo -ne '\t\t [done]\n'
echo -ne 'starting...'
docker run -d --rm \
--name refinery-authorizer \
-p $DEBUG_PORT:$DEBUG_PORT \
-e ENABLE_TELEMETRY=$ENABLE_TELEMETRY \
--network dev-setup_default \
refinery-authorizer-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-authorizer) to start the service\033[0m"
fi
docker logs -f refinery-authorizer